2014-02-04

Changed majority of instances of "blog" to the more generic, and all encompassing, "site."

← Older revision

Revision as of 01:12, 4 February 2014

Line 25:

Line 25:

 

==When Your Domain Name or URLs Change==

 

==When Your Domain Name or URLs Change==

 

 



When your domain name or URLs change - i.e. from http://example.com/blog to http://example.com, or http://example.com to http://example.net - 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.

+

When your domain name or URLs change - i.e. from http://example.com/site to http://example.com, or http://example.com to http://example.net - 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.

 

 

 

If you do a search and replace on your entire database to change the URLs, you ''can'' cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break. To avoid that serialization issue, you have two options:

 

If you do a search and replace on your entire database to change the URLs, you ''can'' cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break. To avoid that serialization issue, you have two options:

Line 41:

Line 41:

 

## If you will be moving your [[WordPress Files|WordPress core files]] to a new directory, create the new directory.

 

## If you will be moving your [[WordPress Files|WordPress core files]] to a new directory, create the new directory.

 

## If you want to move WordPress to your root directory, make sure all [[WordPress Files|index.php]], [[Glossary#.htaccess|.htaccess]], and other files that might be copied over are backed up and/or moved, and that the root directory is ready for the new WordPress files.

 

## If you want to move WordPress to your root directory, make sure all [[WordPress Files|index.php]], [[Glossary#.htaccess|.htaccess]], and other files that might be copied over are backed up and/or moved, and that the root directory is ready for the new WordPress files.



# Log in to your blog.

+

# Log in to your site.

 

# Go to the [[Administration Panels|Administration]] > [[Administration_Panels#Options_-_Configuration_Settings|Settings]] > [[Settings_General_SubPanel|General]] panel.

 

# Go to the [[Administration Panels|Administration]] > [[Administration_Panels#Options_-_Configuration_Settings|Settings]] > [[Settings_General_SubPanel|General]] panel.

 

# In the box for '''WordPress address (URI):''' change the address to the new location of your main WordPress core files.

 

# In the box for '''WordPress address (URI):''' change the address to the new location of your main WordPress core files.

 

# In the box for '''Site address (URL):''' change the address to the new location, which should match the WordPress (your public site) address (URI).

 

# In the box for '''Site address (URL):''' change the address to the new location, which should match the WordPress (your public site) address (URI).

 

# Click '''Save Changes'''.

 

# Click '''Save Changes'''.



# (Do not try to open/view your blog now!)

+

# (Do not try to open/view your site now!)

 

# Move your WordPress core files to the new location. This includes the files found within the original directory, such as <tt><nowiki> http://example.com/wordpress</nowiki></tt>, and all the sub-directories, to the new location.

 

# Move your WordPress core files to the new location. This includes the files found within the original directory, such as <tt><nowiki> http://example.com/wordpress</nowiki></tt>, and all the sub-directories, to the new location.

 

# Now, try to open your site by going to <tt><nowiki>yourdomain.com/wp-admin</nowiki></tt>. Note, you may need to go to <tt><nowiki>yourdomain.com/wp-login.php</nowiki></tt>

 

# Now, try to open your site by going to <tt><nowiki>yourdomain.com/wp-admin</nowiki></tt>. Note, you may need to go to <tt><nowiki>yourdomain.com/wp-login.php</nowiki></tt>

Line 63:

Line 63:

 

# Suppose the files were originally in /path/to/old/ and you moved them to /path/to/new before changing the URIs. The way to fix this would be to make /path/to/old/ a symlink (for Windows users, "symlink" is equivalent to "shortcut") to /path/to/new/, i.e. <tt>ln -s /path/to/new /path/to/old</tt> and then follow the steps [[Moving WordPress#Moving WordPress Within Your Site | above]] as normal. Afterwards delete the symlink if you want.

 

# Suppose the files were originally in /path/to/old/ and you moved them to /path/to/new before changing the URIs. The way to fix this would be to make /path/to/old/ a symlink (for Windows users, "symlink" is equivalent to "shortcut") to /path/to/new/, i.e. <tt>ln -s /path/to/new /path/to/old</tt> and then follow the steps [[Moving WordPress#Moving WordPress Within Your Site | above]] as normal. Afterwards delete the symlink if you want.

 

 



# If you forget to change the WordPress Address and Blog Address, you will be unable to change it using the wordpress interface. However, you can fix it if you have access to the database. Go to the database of your blog and find the wp_options table. This table stores all the options that you can set in the interface. The WordPress Address and Blog Address are stored as siteurl and home (the option_name field). All you have to do is change the option_value field to the correct URL for the records with option_name=’siteurl‘ or option_name=’home‘.

+

# If you forget to change the WordPress Address and Blog Address, you will be unable to change it using the wordpress interface. However, you can fix it if you have access to the database. Go to the database of your site and find the wp_options table. This table stores all the options that you can set in the interface. The WordPress Address and Blog Address are stored as siteurl and home (the option_name field). All you have to do is change the option_value field to the correct URL for the records with option_name=’siteurl‘ or option_name=’home‘.

 

 

 

==== If you have accidentally changed your WordPress site URL ====

 

==== If you have accidentally changed your WordPress site URL ====

Line 83:

Line 83:

 

</pre>

 

</pre>

 

 



You're done. Test your site to make sure that it works right. If the change involves a new address for your blog, make sure you let people know the new address, and consider adding some redirection instructions in your <tt>.htaccess</tt> file to guide visitors to the new location.

+

You're done. Test your site to make sure that it works right. If the change involves a new address for your site, make sure you let people know the new address, and consider adding some redirection instructions in your <tt>.htaccess</tt> file to guide visitors to the new location.

 

 

 

[[Changing The Site URL]] also provides the details of this process!

 

[[Changing The Site URL]] also provides the details of this process!

Line 93:

Line 93:

 

*Note: If you are changing to a new server but same domain, all you need to do is [[Editing_wp-config.php|edit wp-config.php]] with your new database/user information and upload everything as it is to your new server.

 

*Note: If you are changing to a new server but same domain, all you need to do is [[Editing_wp-config.php|edit wp-config.php]] with your new database/user information and upload everything as it is to your new server.

 

 



===If You Don't Care If Your Old Blog Works===

+

===If You Don't Care If Your Old Site Works===

 

 



#Download a copy of the main wordpress files from your OLD blog to your hard drive and [[Editing_wp-config.php|edit wp-config.php]] to suit the new server.

+

#Download a copy of the main wordpress files from your OLD site to your hard drive and [[Editing_wp-config.php|edit wp-config.php]] to suit the new server.



#Go back to your OLD blog and go to [[Administration_Panels|Administration]] > [[Administration_Panels#General|Settings]] > [[Settings_General_SubPanel|General]] and change the url (both of them) to that of your new site.

+

#Go back to your OLD site and go to [[Administration_Panels|Administration]] > [[Administration_Panels#General|Settings]] > [[Settings_General_SubPanel|General]] and change the url (both of them) to that of your new site.

 

#Login on your server and go to phpmyadmin and export as file and save your database (but keep the old one just in case), upload this new database and the copy of the wordpress core files with the edited wp-config.php to your new server. That's it!

 

#Login on your server and go to phpmyadmin and export as file and save your database (but keep the old one just in case), upload this new database and the copy of the wordpress core files with the edited wp-config.php to your new server. That's it!

 

 



===If You Want Your Old Blog To Still Work===

+

===If You Want Your Old Site To Still Work===

 

 



Caution: Make sure you have a backup of your old blog's WordPress database before proceeding!

+

Caution: Make sure you have a backup of your old site's WordPress database before proceeding!

 

 



''Part A - Activating Your New Blog''

+

''Part A - Activating Your New Site''



#Download your entire WordPress installation to your hard drive. Name the folder appropriately to indicate that this is your OLD blog's installation.

+

#Download your entire WordPress installation to your hard drive. Name the folder appropriately to indicate that this is your OLD site's installation.

 

#Download your database.

 

#Download your database.



#Go back to your OLD blog and go to options and change the url (both of them) to that of your new site.

+

#Go back to your OLD site and go to options and change the url (both of them) to that of your new site.



#Again, download your entire WordPress installation to your hard drive. Name the folder appropriately to indicate that this is your NEW blog's installation.

+

#Again, download your entire WordPress installation to your hard drive. Name the folder appropriately to indicate that this is your NEW site's installation.

 

#Download your database once again (but keep the old one). Upload this database to your new server. It will be easiest if you use the same database name and you create a user with the same login credentials on your new server as on your old server.

 

#Download your database once again (but keep the old one). Upload this database to your new server. It will be easiest if you use the same database name and you create a user with the same login credentials on your new server as on your old server.



#If you used a different database name and/or user (see previous step), [[Editing_wp-config.php|edit wp-config.php]] in your NEW blog's installation folder appropriately.

+

#If you used a different database name and/or user (see previous step), [[Editing_wp-config.php|edit wp-config.php]] in your NEW site's installation folder appropriately.



#Upload the NEW blog's installation folder to your new site. Presto, your NEW blog should be working!

+

#Upload the NEW site's installation folder to your new site. Presto, your NEW site should be working!

 

 



''Part B - Restoring Your Old Blog''

+

''Part B - Restoring Your Old Site''



#On the original server, delete your OLD blog's database (remember, you should have a copy on your local computer that you made at the very beginning).

+

#On the original server, delete your OLD site's database (remember, you should have a copy on your local computer that you made at the very beginning).



#Upload your OLD blog's installation folder to your original server, overwriting the files that are currently there (you may also delete the installation folder on the server and simply re-upload the OLD blog's files).

+

#Upload your OLD site's installation folder to your original server, overwriting the files that are currently there (you may also delete the installation folder on the server and simply re-upload the OLD site's files).



#Upload your OLD blog's database from your local computer to the server. That should do it!

+

#Upload your OLD site's database from your local computer to the server. That should do it!

 

 

 

Another procedure for making copies of posts, comments, pages, categories and custom field (post status, data, permalinks, ping status...) easy to follow:

 

Another procedure for making copies of posts, comments, pages, categories and custom field (post status, data, permalinks, ping status...) easy to follow:



#Install a new Wordpress blog

+

#Install a new Wordpress site



#Go on old blog Admin panel. Here, in Manage > Export select "all" in menu Restrict Author.

+

#Go on old site Admin panel. Here, in Manage > Export select "all" in menu Restrict Author.

 

#Click on Download Export File

 

#Click on Download Export File



#In new blog go on Manage > Import, choose Wordpress item.

+

#In new site go on Manage > Import, choose Wordpress item.

 

#In the page that will be shown, select the file just exported. Click on Upload file and Import

 

#In the page that will be shown, select the file just exported. Click on Upload file and Import

 

#It will appear a page. In Assign Authors, assign the author to users that already exist or create new ones.

 

#It will appear a page. In Assign Authors, assign the author to users that already exist or create new ones.

Line 127:

Line 127:

 

#At the end, click on Have fun

 

#At the end, click on Have fun

 

 



''Note: using this method if there are some articles in new blog (like hello world, info page...), these will not be erased. Articles are only added. Using the former procedure the article in new blog will be deleted.''

+

''Note: using this method if there are some articles in new site (like hello world, info page...), these will not be erased. Articles are only added. Using the former procedure the article in new site will be deleted.''

 

 

 

==Moving WordPress Multisite==

 

==Moving WordPress Multisite==

Show more