Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's what I do whenever I have to move a site to a different domain(or from localhost to somewhere on the web): </p> <ol> <li>Make a copy of your files - if you'll be able to zip/unzip a file on both the old and new server, just make a .zip archive with all WordPress files(<code>/wp-admin</code>, <code>/wp-content</code>, <code>/wp-includes</code> and all files in the root directory, otherwise copy them to your computer</li> <li>Make a <a href="http://codex.wordpress.org/Backing_Up_Your_Database" rel="nofollow">Database Copy</a></li> <li>On the new server, upload your files(if you did a .zip archive, upload it and unpack it)</li> <li>Import the database backup on the new server.</li> <li>Once you've uploaded the database, execute the following SQL code(you can do that from phpMyAdmin for instance)</li> </ol> <p>:</p> <pre><code>UPDATE `{%TABLE_PREFIX%}options` SET `option_value` = replace(`option_value`, '{OLD_URL}', '{NEW_URL}'); UPDATE `{%TABLE_PREFIX%}postmeta` SET `meta_value` = replace(`meta_value`, '{OLD_URL}', '{NEW_URL}'); UPDATE `{%TABLE_PREFIX%}posts` SET `post_content` = replace(`post_content`, '{OLD_URL}', '{NEW_URL}'); UPDATE `{%TABLE_PREFIX%}posts` SET `guid` = replace(`guid`, '{OLD_URL}', '{NEW_URL}'); </code></pre> <p>Replace the <code>{%...%}</code> placeholders with the corresponding values as follows:</p> <p><code>{%TABLE_PREFIX%}</code> is your table prefix, as defined in <code>wp-config.php</code></p> <p><code>{OLD_URL}</code> is the old URL where the site resided. I usually skip the <code>http://</code> part and the trailing slash(some paths are saved with, some without it, so it's safer to do it that way), so if your site used to be on <code>http://www.demo.com/</code>, you would replace <code>{OLD_URL}</code> with <code>www.demo.com</code></p> <p><code>{NEW_URL}</code> is the new URL where the site will reside. I usually skip the <code>http://</code> part and the trailing slash, so if your site will reside on <code>http://www.localhost/</code>, you would replace <code>{NEW_URL}</code> with <code>www.localhost</code>. If the new location is a sub-directory(for instance <code>http://www.localhost/example/</code>), you will replace <code>{NEW_URL}</code> with <code>www.localhost/example</code>. </p> <p>Once you're done with all of that, just go to your new installation, log-in to the dashboard, go to <code>Settings &gt; Permalinks</code> and unless you see a .htaccess permissions error, you're all set :)</p> <p>If you can't access the DB via phpMyAdmin, or you can't make a back-up of your files, consider using a <a href="http://wordpress.org/extend/plugins/search.php?q=backup" rel="nofollow">back-up plugin</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload