There are a few backup/etc plugins out there will help you transfer a site from one domain to another or from a development site to your production site. I like to do this process manually and use the following steps:
Steps to Manually Move a Site from One Domain to Another
- Backup the files of the site. If you can SSH into the server, you can run this command from the root directory. Or just download all of the files over FTP.
# tar cfvz mysite.tar.gz *
- Backup the database of the site. Do an export from phpMyAdmin, use a plugin like “WP DB Backup”, or run this from the command line:
# mysqldump -u{db user} -p{db pass} -h{db host} {db name} > mysite.sql
- Upload the files to the new server. If you upload the tar.gz file from step 1, you can untar it like
# tar xfvz mysite.tar.gz
- Create a new database on the new server.
- Import the DB backup. Again you can use something like phpMyAdmin or upload your .sql file to the server and run this line from the command line:
# mysql -u{db user} -p{db pass} -h{db host} {db name} < mysite.sql
- Update
wp-config.php
in the root folder to point to the new DB location/name/user/pass. - Download and install the Search Replace DB script from Interconnect IT.
- Navigate to /searchreplacedb2.php on the new domain. Follow the instructions to select all DB tables.
- Search for olddomain.com
- Replace with newdomain.com
- Your site should work great now when navigating to newdomain.com.
- VERY IMPORTANT: Delete the searchreplacedb2 file and any of your .tar.gz or .sql files from the server. (Or move them outside of the site root so they can’t be downloaded or executed.)
Was this article helpful?
YesNo