Whether you are moving WordPress to a new server or to a different location on your server, you don’t need to reinstall. WordPress is flexible enough to handle all of these situations.
Move WordPress to a New Server
If you are moving WordPress from one server to another, begin by backing up your WordPress directory, images, plugins, and other files on your site as well as the database.
Keeping Your Domain Name and URLs
Moving your domain without changing the Home and Site URLs of your WordPress site is very simple, and in most cases can be done by moving the files.
- If database and URL remain the same, you can move by just copying your files and database.
- If database name or user changes, edit wp-config.php to have the correct values.
- If you want to test before you switch, you must temporarily change “siteurl” and “home” in the database table “wp_options” (through phpMyAdmin or similar).
- If you had any kind of rewrites (permalinks) setup you must disable .htaccess and reconfigure permalinks when it goes live.
Changing Your Domain Name and URLs
- Download your existing site files.
- Export your database – go in to MySQL and export the database.
- Move the backed up files and database into a new folder – somewhere safe – this is your site backup.
- Log in to the site you want to move and go to Settings > General, then change the URLs. (ie from http://example.com/ to http://example.net ) – save the settings and expect to see a 404 page.
- Download your site files again.
- Export the database again.
- Edit wp-config.php with the new server’s MySQL database name, user and password.
- Upload the files.
- Import the database on the new server.
When your domain name or URLs change there are additional concerns. The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.