Languages:
English •
WordPress 日本語
Français

Nederlands
Português do Brasil

Русский

Slovenčina
中文(简体)
(Add your language)

Whether or not you might be transferring WordPress to a brand new server or to a distinct location in your server, you need not reinstall. WordPress is versatile sufficient to deal with all of those conditions.

Transferring to a New Server

In case you are transferring WordPress from one server to a different, start by backing up your WordPress listing, photographs, plugins, and different recordsdata in your web site in addition to the database. See WordPress Backups and Backing Up Your Database.

Conserving Your Area Identify and URLs

Transferring your area with out altering the House and Web site URLs of your WordPress web site may be very easy, and typically will be finished by transferring the recordsdata.

  • If database and URL stay the identical, you’ll be able to transfer by simply copying your recordsdata and database.
  • If database title or person adjustments, edit wp-config.php to have the right values.
  • If you wish to check earlier than you turn, you could quickly change “siteurl” and “dwelling” within the database desk “wp_options” (by means of phpMyAdmin or related).
  • Should you had any form of rewrites (permalinks) setup you could disable .htaccess and reconfigure permalinks when it goes dwell.

Altering Your Area Identify and URLs

Transferring a web site and altering your area title or URLs (i.e. from http://instance.com/web site to http://instance.com, or http://instance.com to http://instance.web) requires the next steps – in sequence.

  1. Obtain your current web site recordsdata.
  2. Export your database – go in to MySQL and export the database.
  3. Transfer the backed up recordsdata and database into a brand new folder – someplace secure – that is your web site backup.
  4. Log in to the location you wish to transfer and go to Settings > Normal, then change the URLs. (ie from http://instance.com/ to http://instance.web ) – save the settings and anticipate to see a 404 web page.
  5. Obtain your web site recordsdata once more.
  6. Export the database once more.
  7. Edit wp-config.php with the brand new server’s MySQL database title, person and password.
  8. Add the recordsdata.
  9. Import the database on the brand new server.

When your area title or URLs change there are further issues. The recordsdata and database will be moved, nonetheless references to the outdated area title or location will stay within the database, and that may trigger points with hyperlinks or theme show.

Should you do a search and exchange in your total database to alter the URLs, you can trigger points with information serialization, attributable to the truth that some themes and widgets retailer values with the size of your URL marked. When this adjustments, issues break. To keep away from that serialization difficulty, you’ve got 4 choices:

  1. Use the Velvet Blues Replace URLs plugin for those who can entry your WP Admin Dashboard.
  2. Use the Higher Search Substitute plugin for those who can entry your WP Admin Dashboard.
  3. Use WP-CLI’s search-replace in case your internet hosting supplier (otherwise you) have put in WP-CLI.
  4. Use the Search and Substitute for WordPress Databases Script to soundly change all situations in your outdated area or path to your new one. (** solely use this feature if you’re comfy with database administration ** )

Notice: Search and Substitute from Interconnectit is a third occasion script

Transferring Directories On Your Present Server

Transferring the WordPress recordsdata from one location in your server to a different – i.e. altering its URL – requires some particular care. If you wish to transfer WordPress to its personal folder, however have it run from the basis of your area, please learn Giving WordPress Its Personal Listing for detailed directions.

Listed here are the step-by-step directions to maneuver your WordPress web site to a brand new location on the identical server:

  1. Create the brand new location utilizing one in all these two choices:
    1. If you may be transferring your WordPress core recordsdata to a brand new listing, create the brand new listing.
    2. If you wish to transfer WordPress to your root listing, make sure that all index.php, .htaccess, and different recordsdata that is perhaps copied over are backed up and/or moved, and that the basis listing is prepared for the brand new WordPress recordsdata.
  2. Log in to your web site.
  3. Go to the Administration > Settings > Normal display.
  4. Within the field for WordPress Deal with (URL): change the tackle to the brand new location of your major WordPress core recordsdata.
  5. Within the field for Web site Deal with (URL): change the tackle to the brand new location, which ought to match the WordPress (your public web site) tackle.
  6. Click on Save Modifications.
  7. (Don’t attempt to open/view your web site now!)
  8. Transfer your WordPress core recordsdata to the brand new location. This consists of the recordsdata discovered throughout the authentic listing, reminiscent of http://instance.com/wordpress, and all of the sub-directories, to the brand new location.
  9. Now, attempt to open your web site by going to yourdomain.com/wp-admin. Notice, you could have to go to yourdomain.com/wp-login.php
  10. In case you are utilizing Permalinks, go to the Administration > Settings > Permalinks display and replace your Permalink construction to your .htaccess file, which needs to be in the identical listing as the primary index.php file.
  11. Present picture/media hyperlinks uploaded media will confer with the outdated folder and should be up to date with the brand new location. You are able to do this with the Velvet Blues Replace URLs or Higher Search Substitute plugins, WP-CLI’s search-replace in case your internet hosting supplier (otherwise you) have put in WP-CLI, manually in your SQL database, or through the use of the third occasion database updating software Search and Substitute Databases Script * Notice: this script is finest utilized by skilled builders.
  12. In some instances your permissions might have modified, relying in your ISP. Look ahead to any recordsdata with “0000” permissions and alter them again to “0644”.
  13. In case your theme helps menus, hyperlinks to your private home web page should still have the outdated subdirectory embedded in them. Go to Look > Menus and replace them.
  14. Typically you would wish to restart your server, in any other case your server might give out an error. (occurs in MAMP software program (Mac)).

It is crucial that you simply set the URI places BEFORE you progress the recordsdata.

If You Neglect to Change the Areas

Should you by chance moved the recordsdata earlier than you modified the URIs: you’ve got two choices.

  1. Suppose the recordsdata had been initially in /path/to/outdated/ and also you moved them to /path/to/new earlier than altering the URIs. The best way to repair this is able to be to make /path/to/outdated/ a symlink (for Home windows customers, “symlink” is equal to “shortcut”) to /path/to/new/, i.e. ln -s /path/to/new /path/to/outdated after which comply with the steps above as regular. Afterwards, delete the symlink in order for you.
  2. Should you overlook to alter the WordPress Deal with and Weblog Deal with, you may be unable to alter it utilizing the wordpress interface. Nonetheless, you’ll be able to repair it you probably have entry to the database. Go to the database of your web site and discover the wp_options desk. This desk shops all of the choices that you may set within the interface. The WordPress Deal with and Weblog Deal with are saved as siteurl and residential (the option_name area). All it’s a must to do is change the option_value area to the right URL for the information with option_name=’siteurl‘ or option_name=’dwelling‘.

If You Have By accident Modified your WordPress Web site URL

Suppose you by chance modified the URIs the place you can’t transfer the recordsdata (however can nonetheless entry the login web page, by means of a redirection or one thing).

wp-login.php can be utilized to (re-)set the URIs. Discover this line:

require( dirname(__FILE__) . ‘/wp-load.php’ );

and insert the next traces beneath:

//FIXME: do remark/take away these hack traces. (as soon as the database is up to date)
update_option(‘siteurl’, ‘http://your.area.title/the/path’ );
update_option(‘dwelling’, ‘http://your.area.title/the/path’ );

You are finished. Check your web site to be sure that it really works proper. If the change entails a brand new tackle in your web site, be sure you let folks know the brand new tackle, and think about including some redirection directions in your .htaccess file to information guests to the brand new location.

Altering The Web site URL additionally gives the small print of this course of.

If Your WordPress Web site Has a Personalized upload_path Worth

It is potential, however unlikely, that the upload_path possibility worth could also be set on some very outdated WordPress websites, or on websites the place the designer wanted to customise this path. On this case, you need to confirm that the trail remains to be legitimate after the transfer, and modify it because it wanted. If an absolute moderately than a relative path was used, the trail could also be incorrect to be used on the brand new server. An incorrect add path will lead to issues with media uploads and potential filesystem errors when WordPress makes an attempt to create add directories on the improper path. (See ticket ticket #41947.)

The upload_path possibility can’t be modified on the WordPress admin settings display, it should be edited within the choices desk within the database.

Usually, the upload_path worth could also be clean and WordPress will use the default path. If the worth will not be clean and incorporates a worth aside from the default add location, you could have to do additional analysis to find out find out how to deal with uploads on the location after the transfer.

Managing Your Outdated Web site

Shutting It Down

  1. Obtain a duplicate of the primary wordpress recordsdata out of your OLD web site to your onerous drive and edit wp-config.php to go well with the brand new server.
  2. Return to your OLD web site and go to Administration > Settings > Normal and alter the URL (each of them) to that of your new web site.
  3. Login in your server, go to phpMyAdmin, export as file, and save your database (however preserve the outdated one simply in case). Now, add this new database and the copy of the wordpress core recordsdata with the edited wp-config.php to your new server. That is it!

Conserving it Working

Warning: Be sure to have a backup of your outdated web site’s WordPress database earlier than continuing!

Half A – Activating Your New Web site

  1. Obtain your total WordPress set up to your onerous drive. Identify the folder appropriately to point that that is your OLD web site’s set up.
  2. Obtain your database.
  3. Return to your OLD web site and go to choices and alter the url (each of them) to that of your new web site.
  4. Once more, obtain your total WordPress set up to your onerous drive. Identify the folder appropriately to point that that is your NEW web site’s set up.
  5. Obtain your database as soon as once more (however preserve the outdated one). Add this database to your new server. It will likely be best for those who use the identical database title and also you create a person with the identical login credentials in your new server as in your outdated server.
  6. Should you used a distinct database title and/or person (see earlier step), edit wp-config.php in your NEW web site’s set up folder appropriately.
  7. Add the NEW web site’s set up folder to your new web site. Presto, your NEW web site needs to be working!

Half B – Restoring Your Outdated Web site

  1. On the unique server, delete your OLD web site’s database (bear in mind, you need to have a duplicate in your native laptop that you simply made on the very starting).
  2. Add your OLD web site’s set up folder to your authentic server, overwriting the recordsdata which might be at the moment there (you might also delete the set up folder on the server and easily re-upload the OLD web site’s recordsdata).
  3. Add your OLD web site’s database out of your native laptop to the server. That ought to do it!

One other process for making copies of posts, feedback, pages, classes and customized area (put up standing, information, permalinks, ping standing, and so forth.) simple to comply with:

  1. Set up a brand new WordPress web site
  2. Go on outdated web site Administration Display. Right here, in Handle > Export choose “all” in menu Prohibit Writer.
  3. Click on on Obtain Export File
  4. In new web site go on Handle > Import, select WordPress merchandise.
  5. Within the web page that might be proven, choose the file simply exported. Click on on Add file and Import
  6. It is going to seem a web page. In Assign Authors, assign the writer to customers that exist already or create new ones.
  7. Click on on Submit
  8. On the finish, click on on Have enjoyable

Notice: utilizing this technique, if there are some articles within the new web site (like Hey World, Information Web page, and so forth.), these will not be erased. Articles are solely added. Utilizing the previous process, the articles in new web site might be deleted.

Transferring WordPress Multisite

Multisite is considerably extra sophisticated to maneuver, because the database itself has a number of references to the server title in addition to the folder places. Should you’re merely transferring to a brand new server with the identical area title, you’ll be able to copy the recordsdata and database over, precisely as you’ll a standard set up.

If, as an alternative, you might be altering domains, then the easiest way to maneuver Multisite is to maneuver the recordsdata, edit the .htaccess and wp-config.php (change DOMAIN_CURRENT_SITE and, if the folder title containing Multisite modified, PATH_CURRENT_SITE), after which manually edit the database. Seek for all situations of your area title, and alter them as wanted. This step can not but be simply automated. It is secure to look/exchange any of the wp_x_posts tables, nonetheless don’t try blanket search/exchange with out the Search and Substitute for WordPress Databases script (aka the interconnectit script).

Should you’re transferring Multisite from one folder to a different, you have to to be sure you edit the wp_blogs entries to alter the folder title accurately. You need to manually assessment each wp_site and wp_blogs regardless, to make sure all websites had been modified accurately.

Additionally, manually assessment all of the wp_x_options tables and search for 4 fields and edit them as wanted:

  • dwelling
  • siteurl
  • upload_path
  • upload_url_path

The add path and URL might be empty if the default media paths are used.

In case you are transferring from subdomains to subfolders, or vice-versa, bear in mind to regulate the .htaccess file and the worth for SUBDOMAIN_INSTALL in your wp-config.php file accordingly.

Supply