Moving WordPress from one server to another

Moving WordPress from one server to another is pretty simple. It actually shall not take longer as five minutes following this steps:

1st step – server environment

Check if the basic server environment is the same as you had on the server before, especially for

  • PHP-Version (some modules require PHP5 and higher)
  • Database-Version (maybe important for your data import)
  • special PHP modules (e.g. if you use permalinks, make sure mod_rewrite is activated and running)

If you feel like there is everything alright on the new server, you may want to go ahead.

2nd step – the database

  • Export the WordPress database of your former server to a sql-file or to a compressed sql-file. You may either use a GUI tool like phpMyAdmin or the terminal.
  • Import this (compressed) sql-file into the database on your server. Use the import function of your GUI tool to do so or the terminal if you are able to login with putty.
  • Change the path settings: In the new database of your webserver, you shall find a table called wp-options. In option_id="2", option_name="siteurl" you will find the path settings you entered during the initial installation process

romana1

3rd step – the files

  • Connect to your previous server via FTP and download the files of your WordPress document root.
  • Upload this files to you new server.
  • Using your FTP client, go to the new server’s WordPress document root and open the file wp-config.php. Adapt the new server’s database name, the database server (if needed, localhost is used mostly), the database user name and the database password.
  • Check the permissions needed for proper work of your new system:
    wp-config.php has to be set to 0644
    – for pucture uploads etc, /wp-content/uploads/ shall be writable (0755 or 0777)
    – for updates or automatic plugin installation, /wp-content/plugins/ and /wp-content/upgrades/ shall be writable (0755 or 0777)
  • Take care: In Unix-World, e.g. if you are using any Linux or Mac (AFAIK with a FreeBSD under the hood), dotted files are not shown and not copied by default using your FTP client. So the .htaccess file which is important if you activated the so called “Permalinks” may be not transferred. Make sure it is on his place.
  • Go to Admin -> Settings -> Permalinks. In case you activated this options, at the bottom of this page the current content of your .htaccess appears like it should be. Probably the value for your RewriteBase changed. Copy this content and overwrite the .htaccess on your server.

You are done! Congratulations hero!

0

Leave a Reply

Your email address will not be published. Required fields are marked *