THIS IS A WALKTHROUGH FOR: HOW TO BACKUP WORDPRESS DATABASE AND FILES FOR MOVING LIVE.

WordPress Backup

This is a detailed process of how to move your wordpress site to another server.

This is for wordpress experienced users and should not be attempted by new users. USE THIS INFORMATION AT YOUR OWN RISK! I will not be held accountable for "broken" sites. If you have issues feel free to use the contact form at the bottom of this page. This information is useful to intermediate and advanced WordPress users and Website Developers. Typically when I move a WordPress development site onto the live site this is the process I go through. Its about time I typed this out...

The process involves:

  • 1.) exporting a database
  • 2.) backing up files with FTP
  • 3.) importing a database, and changing some fields in the database
  • 4.) uploading the FTP backup
  • 5.) Using a WordPress Plug-In "search and Replace" to fix database links

ON THE OLD SERVER:

BACKUP DATABASE INSTRUCTIONS:

  • 1.) First I go to godaddy.com or log into cpanel or whatever server management system is available, and open the database with phpMyAdmin on the development site/old server.
  • 2.) Log into the database with phpMyAdmin
  • 3.) Select the table (usually on the left) NOT labelled information_schema, and click "Export"
  • 4.) Do an export to text, meaning DO NOT export to file, and in the next window copy and paste the sql into an editor of your choice (Notepad, Notepad++). Now here is the trick, save the file as a .sql file, but be sure to delete the two lines that resemble: i.) " CREATE DATABASE `db_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; ii.) USE `db_name`; " - Note: The reason you delete these two lines is because if you don't you run into a problem when trying to import the database into the new database on the new server.
  • 5.) Then save the .sql file again.

FTP BACKUP INSTRUCTIONS:

  • If you haven't already install a FTP Client Program like Filezilla Link to FileZilla
  • Once you have it installed, open your FTP Client
  • Configure your FTP information: [host (ftp.example.com), username, and password] (in "Site Manager" if using FileZilla)
  • Connect to your server
  • If successful you should see the files in the root of your server
  • Now, make a backup of the file system / directory structure by downloading everything in the root of the server to your computer as a backup.
  • Wait for the file transfer to finish and move on to the next step.

ON THE NEW SERVER:

Now, here is where some things can go wrong, but as long as you have a good backup there should be no problem. At this point you can also make a backup of WordPress using plugins which is explained at the bottom of this page.

FTP INSTRUCTIONS:
Now transfer the backup of the file system / directory structure from your computer to the new server through FTP (make sure you have the "Site Manager" configured for your new site in your FTP Client)

We must change some values in the WordPress database so that we can log into the site.
DATABASE IMPORT INSTRUCTIONS:

  • 1.) First I go to godaddy.com or log into cpanel or whatever server management system is available, and open the database with phpMyAdmin on the development site/old server.
  • 2.) Log into the database with phpMyAdmin
  • 3.) Select the table (usually on the left) NOT labelled "information_schema", and click "Import"
  • 4.) Select the .sql file you saved earlier and complete the import.
  • 5.) Now, select the table NOT labelled "information_schema" AGAIN
  • 6.) Select the "wp_options" table (on the left) and click "Browse" (on the right)
  • 7.) Look for "siteurl" field and click the little pencil to edit the entry.
    - This link should be the old development site URL ex. http://example.com/dev or http://dev.example.com
  • 8.) Change the "siteurl" to the new domain ex. http://yournewsite.com
  • 9.) Once finished editing the "sitrurl" click "Go" to finish the edit.
  • 10.) On the next page, Look for the "home" field and click the little pencil to edit the entry.
    - This link should be the old development site URL ex. http://example.com/dev or http://dev.example.com
  • 11.) Change the "home" to the new domain ex. http://yournewsite.com
  • 12.) Once finished editing the "home" click "Go" to finish the edit.

WORDPRESS INSTRUCTIONS:
Once the files have finished moving (this is important) and the database "home" and "siteurl" entries have been set, you can log into http://yournewsite.com/wp-admin.

Now we must change all the links in the database to reflect the new site links:
WORDPRESS SEARCH AND REPLACE PLUG-IN INSTRUCTIONS:

  • Log into WordPress
  • Install the Plug-In "Search and Replace" and activate the plug-in
  • In wordpress go to Tools -> Search and Replace
  • Scroll down to the "Search In" section and check the check-boxes for "Content" and "GUID":
  • In the "Search For" box put the old URL ex. http://http://example.com/dev or http://dev.example.com
  • In the "Replaced With" box put the new URL ex. http://yournewsite.com
  • Then click "Go" to save your changes, and a message should say you have changed "58" entries!! (For my website which is small it said 58 entries)
  • Go to your new site address in a browser and make sure all the links are to the new site and that nothing is broken! ex. http://yournewsite.com

NOW DONT FORGET THIS PART!!!:
You need to go to your permalink page and change your settings at least once. Therefore, if you have never changed your permalinks then you need to change it to something like "Post name" for the links to work properly. If you have already selected "Post name" in the past, then the best option would be to select "Default" which will return your pages back to using page ids, and then select your original choice gain. The idea here is to reset the page links back to IDs then to another permalink choice of your liking.

If you DO NOT have access to FTP or DATABASE, but you have WordPress Administrative rights.

THIS IS A GUIDE FOR USERS WITHOUT FTP OR DATABASE ACCESS:
The other way would be to use these two free plugins:

  • WordPress Database Backup
    Version 2.2.4 (POSTED ON - 3/2/14) | By Austin Matzko | Visit plugin site Just simply extract the zip and upload the extracted folder "wp-db-backup" to /wp-content/plugins via FTP To Use: Activate in WordPress -> Hover over "Settings" (in WordPress dashboard) -> Click on "Wordpress Backup" -> Set Interval and email (optional) -> Click "Update WordPress Backup Options" -> DONE!
  • WordPress Backup (by BTE)
    Version 1.6.4 | By Blog Traffic Exchange | Visit plugin site Just simply extract the zip and upload the extracted folder "wordpress-backup" to /wp-content/plugins via FTP.WARNING: The BTE plug-in creates a folder called "bte-wb" in the /wp-content/ folder. (Location: /wp-content/btw-wb/) To Use: Activate in WordPress -> Hover over "Tools" (in WordPress dashboard) -> Click on "Backup" -> Scroll down to "Backup Options" -> Select "Save to Server" radio button *FIRST* -> WAIT FOR THE BACKUP TO FINISH *OR ELSE* -> DONE!

Leave a Reply