How to copy file structure from wordpress website to new host - wordpress

I'm having troubles moving my current website to a new host. The website is hosted on a www.website.org/wordpress and I need to move the entire website to a new server to which I have access via ssh and ftp.
The plan is the usual, backup all files and the database and then move the files to the new server, where the website will be hosted in a new address. But the tutorials that I've found use cPanel or other management tools that I don't think that I have access to.
The other method is to try and copy every file from my current webhost using ftp, but I don't know how to connect to the website and copy all files.
Somehow I'm having problems downloading the files from my website to my computer to move them to the new server.
Is there a simple step that I'm missing on how to log into the website to copy the file structure from wordpress?
Thanks in advance for any responses.

Through ssh you should try the scp command.
You can read more in this explicative answer How to copy a folder from remote to local using scp?.
EDIT
In your case would be:
scp -r user#sourcewebsite.com:/path/to/wp user#destinationwebsite.com:/home/user/Desktop/
Let's check that source and destination folder paths actually exist.

Related

How can I change permission for an Azure Web App, so I can actually upload files via FTP to it?

How can I change permission for a Web App, so I can actually upload files via FTP to it?
What is it I need to change in order to have permissions to upload via FTP?
I have a running site that runs ASP.Net Core. Everything works.
For debugging purposes on a weird js issue, I need to be able to edit a few js files directly on the site via FTP.
When I connect via FTP (with the credentials from the "publish profile") I can connect just fine and download files - I use Filezilla.
But if I try to upload anything, I get "550 Access is denied."
I have full access to Azure Portal etc for the site, incl. Kudu.
It does not matter if you can upload files via KUDU or some other thing - I specifically need FTP.
Thanks for asking question! Could you please check if your firewall is blocked outgoing FTP writes.
Also, make sure you're not trying to write to a read-only file. For this suggest using the Kudu Console (https://[sitename].scm.azurewebsites.net/DebugConsole) to look at your files and check their permissions (e.g. using 'attrib' command).
For more information about KUDU, please refer to this document
Refer to this document link might be helpful: https://learn.microsoft.com/en-us/azure/app-service/deploy-ftp#get-ftp-connection-information
Try checking the ftp link which is provided by deployment center, For this Go to your web app, click Get publish profile, choose the Publish URL under tag <publishProfile profileName="your-webapp"

Why wordpress redirecting me to the old website, after I migrated it to my local machine?

I migrated my wordpress website into my local machine, but it's redirecting me to the original ,-server one-, website, immediately after I opennig the local one.
I try to describe what did I do as detailed as much I can:
First I got all wp files and copied-d it to my local XAMPP htdocs directory via SHH (FROM Linux Debian 10 - Apache 2 Webserver).
After that I exported the database (exported to sql file format).
I created the same database and user (with the same permissions as the server db user) in the local webserver
Everything went successfully, but after i want to open http://localhost/ I got redirected to my old site like https://originalsite.com
What did I tried to solve the problem:
I checked Apache, PHP and phpmyadmin version, but these are the same.
I reinstalled XAMPP but that also didn't solve the problem.
I checked wp-config.php but there aren't any options I've could been change, php.ini and my.ini both of them not gave me any alternative.
Thanks!
In the .sql file you imported, find "site_url" and change it to localhost URL. Or you can define it in wp-config.php file as "WP_SITEURL"
You will need to manually go in Database and Replace LIVE site URL with the Local URL.
Something like:
https://originalsite.com/
TO
http://localhost/originalsite

Share my local wordpress site with another developer with git

I want to share my local wordpress site with another developer with git in a way our database will be same when he setups my wordpress site in his local PC.
I am using windows 7 OS
I'm not sure if what you are asking for is possible.
here is my suggestion (the database should be on a real server)
if you use CPanel:
1- In the CPanel create the database and new user and assign the user to the database
2- In the CPanel Go to Remote MySQL, add your IP address and the other developer IP address. (to allow remote access)
3- Export the database from your local PC and import it to the CPanel.
4- Change the wp-config.php configuration.
Note: The urls should be the same on your PC and the developer pc.
for example if your website url on your pc is : http://localhost/mywebsite/
the other developer should make it the same.
I would suggest keeping your database out of git (except perhaps the database definitions).
Instead you can leverage git hooks. Using something like pre-push, run a mysql dump command to get the current state of your db, and copy it to a shared Dropbox/Drive folder with your team mate.
.git/hooks/pre-push
#!/bin/bash
mysqldump -u root -p --all-databases > ~/Dropbox/shared-with-tm/mysql.sql
Completely untested This is a vague answer to answer a vague question - but might give you a starting point.

Local Drupal website connecting to a remote database

I'm new to Drupal. I want to run my Drupal website locally and connect directly to the remote database, but I can't seem to figure out how to do it. I have MAMP installed on the Mac and I have all the files in the htdocs folder. It looks like I just need to change the settings.php file to match my remote database, but I'm unsure what I need to change.
I guest you look at this drupal.org HowTo that step by step guides you through creating the database and what you need to change before running the Install program.
https://www.drupal.org/node/66187
Also check the comments on that thread.
Yes, you have to adjust your settings file (/sites/default.settings.php), database configuration. Watch out, usually there is a different ("external") host for accessing database from out of server. I think that it can be set per database user does it has privileges to access database from outer server or not. Maybe there's some special user for that.
There should not be any extra setup or configuration. Just make sure that
You are connected to the remote database (usually goes in sites/default/settings.php).
The database host allows remote connections.

How to handle permalink of sites when migrating a wordpress website

What i want to do:
Develop a Wordpress-based website with a local Wordpress installation (and xampp).
Migrate this developed website on my webserver.
What's the problem:
After putting the website on the webserver each link in the navigation references to "127.0.0.1/wordpress/...".
I'm not even able to login to the Wordpress Backend on the webserver, because the "login.php" (or something) is also referenced on the localhost"
My Question:
Do any of you know how I can change this permalinks to the URL of the webserver the website is actually deployed on?
best regards
matt
edit:
Another thing that i noticed is, that although I changed the URL in the wp_posts table manually, this database entries are changed by wordpress, so next time, after opening the website, the URLs in the database contains the 127.0.0.1 part
When migrating the database from your local machine to a remote server, you should export your mysql database that is on your local machine to a file. Then perform a search and replace changing "127.0.0.1/wordpress/..." to "www.yourdomain.com/path/to/wordpress" and then import that file to your new mysql database.
Since you have already moved everything over, you can just export the database tables from your remote server to a file, do the search and replace on that, and reimport it. When exporting the database make sure to check "Add Drop Table / Drop View".
It's very simple, do everything you need in local, when you're ready to deploy, export your local database from phpMyAdmin, open the file and do "search and replace" your local path with your server path.
Chnage the connection string inside config.php and you're done.

Resources