{"id":417,"date":"2009-03-03T14:27:36","date_gmt":"2009-03-03T14:27:36","guid":{"rendered":"http:\/\/sitepress.org\/?p=417"},"modified":"2009-04-20T00:45:13","modified_gmt":"2009-04-20T00:45:13","slug":"wordpress-migration-in-5-minutes","status":"publish","type":"post","link":"https:\/\/wpml.org\/zh-hans\/tutorials\/2009\/03\/wordpress-migration-in-5-minutes\/","title":{"rendered":"WordPress Migration in 5 Minutes"},"content":{"rendered":"<p>I just had the pleasure of migrating this website from one WordPress install to the other. At first, I searched for advice on how to do this, leading me in weird directions (mostly revolving around mysql dumps).<\/p>\n<p>It turns out this procedure can be much simpler than anticipated, given you&#8217;re doing things in their correct order. Here is what I did&#8230;<\/p>\n<h3>Some Background<\/h3>\n<p>I moved my site from <strong>WordPressMU<\/strong> to <strong>WordPress<\/strong> leaving the domain name intact.<\/p>\n<p>This move was necessary. I was using WPMU for reasons that have long expired and the restrictions that it kept imposing were impossible for me. In addition, some plugins that I must use don&#8217;t work on WPMU.<\/p>\n<p>Both sites run on the same server. Also, the domain name didn&#8217;t change. These two facts don&#8217;t matter much. I&#8217;ll explain the more general case where the move can be across servers and the site&#8217;s address can change.<\/p>\n<h3>Export from the current WordPress site<\/h3>\n<p><a href=\"http:\/\/wpml.org\/wp-content\/uploads\/2009\/03\/export.jpg\"><img decoding=\"async\" class=\"alignright size-medium wp-image-418\" title=\"Export tool\" src=\"http:\/\/wpml.org\/wp-content\/uploads\/2009\/03\/export-300x138.jpg\" alt=\"Export tool\" width=\"300\" height=\"138\" srcset=\"https:\/\/wpml.org\/wp-content\/uploads\/2009\/03\/export-300x138.jpg 300w, https:\/\/wpml.org\/wp-content\/uploads\/2009\/03\/export-150x69.jpg 150w, https:\/\/wpml.org\/wp-content\/uploads\/2009\/03\/export.jpg 702w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>I went to the admin panel, clicked on <strong>Tools <\/strong>and used the <strong>Export <\/strong>feature.<\/p>\n<p>This tool doesn&#8217;t need much in order to work. You can restrict the data to be exported according to the author (which I didn&#8217;t use). Then, you save the exported file locally.<\/p>\n<p>The file you get is an XML file. Save it somewhere handy as you&#8217;re going to have to open it in a minute.<\/p>\n<h3>Create backup for all the uploaded files and download it locally<\/h3>\n<p>The <em>export<\/em> process will include all the texts in your website (posts, pages, comments, categories, etc.).<\/p>\n<p>To include uploaded files, such as images, movies and audio, I suggest that you download them all as one big TAR file. My original site was a WPMU site so the files were located in:<\/p>\n<pre>wp-content\/blogs.dir\/BLOG_ID\/files<\/pre>\n<p>Open a shell window (SSH), go to that directory and grab it all by typing:<\/p>\n<pre>zip -r wp_files.zip *<\/pre>\n<p>Now, you&#8217;ll have one pretty large file called wp_files.zip. Use an FTP program to download it locally.<\/p>\n<p>While you&#8217;re at it, do the same for your theme(s). Go to your themes directory and create an archive of your theme(s).<\/p>\n<pre>zip -r themes.zip theme1 theme2...<\/pre>\n<h3>Create the new WordPress site<\/h3>\n<p>Next, comes the standard WordPress install for the new site (where we&#8217;re going to transfer to).<\/p>\n<p>Web server admin panels normally come with handy utilities that allow you to create this all in one click. I created the MySQL database manually, edited wp-config.php and adjusted the Apache configuration file to point to the new site.<\/p>\n<p>If you&#8217;re also moving boxes, this would also be the time to update the Domain Name Server (DNS) entry for that site. Don&#8217;t wait until the DNS entry propegates all the way down to your PC. Instead, open the <strong>hosts<\/strong> file in your PC (in Windows c:\\Windows\\System32\\drivers\\etc\\hosts) and add an entry for your new site with the new IP address. Remember to delete this entry in a couple of days.<\/p>\n<h3>Add the uploaded files and theme<\/h3>\n<p>Once the new WordPress site has been installed you can add back all the uploaded data and your theme.<\/p>\n<p>Store that wp_files.zip file in:<\/p>\n<pre>\/wp-contents\/uploads<\/pre>\n<p>Unzip it there by opening a shell window and typing:<\/p>\n<pre>unzip wp_files.zip<\/pre>\n<p>There you go! All your uploaded files have been moved at once and will appear in your new blog.<\/p>\n<p>Do the same for the themes. Copy to \/wp-contents\/themes and unzip there.<\/p>\n<h3>Patch up the exported file<\/h3>\n<p>This is the most critical part of this whole migration, so pay attention and handle with care.<\/p>\n<p>Open that <strong>Export<\/strong> file you saved before. You can use any text editor, but don&#8217;t use a program that&#8217;s going to change the format (e.g. Word). <strong>Notepad<\/strong> would be just fine for this purpose (Start-&gt;Accessories-&gt;Notepad).<\/p>\n<p>There are two things that need to be replaced:<\/p>\n<ol>\n<li>Uploaded files (if they need to be moved)<\/li>\n<li>Domain name (if that has changed)<\/li>\n<\/ol>\n<p>I moved all the existing uploaded files from \/files\/ to \/wp-contents\/. This was a required step as I migrated from WPMU to WordPress. You don&#8217;t need to change anything if you&#8217;re moving from and to the same WordPress type.<\/p>\n<p>If you&#8217;re changing the domain name, do a global replace and change from the old one to the new one. There should be lots of places where this appears &#8211; change them all.<\/p>\n<p>Save the file to a different name, so that you have both the original and your edits. You&#8217;ll want to have the original in case your edits cause it to be broken. XML files cannot be loaded if their formatting is damaged.<\/p>\n<h3>Import the data<\/h3>\n<p><a href=\"http:\/\/wpml.org\/wp-content\/uploads\/2009\/03\/import1.jpg\"><img decoding=\"async\" class=\"alignright size-medium wp-image-422\" title=\"Import tool\" src=\"http:\/\/wpml.org\/wp-content\/uploads\/2009\/03\/import1-300x124.jpg\" alt=\"Import tool\" width=\"300\" height=\"124\" srcset=\"https:\/\/wpml.org\/wp-content\/uploads\/2009\/03\/import1-300x124.jpg 300w, https:\/\/wpml.org\/wp-content\/uploads\/2009\/03\/import1-150x62.jpg 150w, https:\/\/wpml.org\/wp-content\/uploads\/2009\/03\/import1.jpg 591w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>It&#8217;s time to use that data back to your blog, making all your contents available again.<\/p>\n<p>Click on <strong>Tools<\/strong>-&gt;<strong>Import<\/strong>-&gt;<strong>WordPress<\/strong>.<\/p>\n<p>Select the file we patched before and click on &#8216;Upload file and import&#8217;.<\/p>\n<p>WordPress will offer you to download files. <strong>Don&#8217;t select this option<\/strong>. We&#8217;ve already transfered all the uploaded files from your new blog to this one. We&#8217;ve done it in one go instead of doing this individually.<\/p>\n<p>At this point, WordPress will also offer you to assign posts to users. It&#8217;s a good time to recreate the old authors now.<\/p>\n<h3>Configure your new site<\/h3>\n<p>Go to your new site and follow the WordPress install wizard (just one step). Then, before jumping in to anything, go through the <strong>Settings<\/strong> section and adjust everything that needs changing. I had to change:<\/p>\n<ol>\n<li>Settings: Changed the blog&#8217;s tagline<\/li>\n<li>Reading: Changed the default home and blog page.<\/li>\n<li>Permlinks: Changed from the default permlinks structure to year and month.<\/li>\n<li>Discussion: Enabled threaded comments<\/li>\n<\/ol>\n<p>Of course, your adjustments would probable be different. The point is that you should really go through all the pages under Settings and make sure that they&#8217;re right for you.<\/p>\n<h3>Add plugins<\/h3>\n<p>I could have also zipped the plugins directory and included that in the move, but I didn&#8217;t. As long as I&#8217;m already refreshing things, I thought it might be a good idea to redownload all my plugins from the WP plugins repository (you know, get the fresh versions of everything).<\/p>\n<p>The improved (fixed) search facility available as of WP2.7.1 makes it much easier. Click on <strong>Plugins<\/strong>-&gt;<strong>Add<\/strong>, search for each plugin, download and activate. Took less than a minute for all my plugins.<\/p>\n<h3>Enable your theme<\/h3>\n<p>Once everything is back in place, it&#8217;s time to enable your theme (which might rely on plugins to work correctly).<\/p>\n<p>Go to <strong>Appearance<\/strong>-&gt;<strong>Themes<\/strong> and select your.<\/p>\n<p>You&#8217;re all done!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just had the pleasure of migrating this website from  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_uag_custom_page_level_css":"","ep_exclude_from_search":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-417","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"spectra_custom_meta":{"_edit_lock":["1240188313"],"_edit_last":["1"],"_alp_processed":["1408520723"],"_oembed_9596c0d9095e7ce9cc90624324ef4422":["<iframe title=\"Duplicator For WordPress Quick Overview\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/yZ7pHmR9JC8?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_9596c0d9095e7ce9cc90624324ef4422":["1631716567"],"_oembed_12570cf8030926800bac0f1584e1e153":["<iframe title=\"How to use the backup wizard in cpanel\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/eS-tCkc-gm0?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_12570cf8030926800bac0f1584e1e153":["1631716567"],"_oembed_1c0ef2e069ab1e666be8a1bac83a42ee":["{{unknown}}"],"_oembed_e9018e6807d31b4505b7ad464275fdce":["<iframe title=\"How to copy multiple accounts from another server to your WHM server using SSH\" width=\"525\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/C6ro9h0qowU?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_e9018e6807d31b4505b7ad464275fdce":["1631716567"],"_oembed_9052213bd50132682bbabb79e50bace9":["<iframe title=\"How to use FTP to upload files to WordPress for Beginners\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/_nDQz1JQfYA?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_9052213bd50132682bbabb79e50bace9":["1631716567"],"_oembed_cfcc8d32f359dd000173b240cccb4392":["{{unknown}}"],"_oembed_d617e060b7133aea5401c0d73edbabae":["<iframe title=\"Using WPML to easily translate pages you build visually\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/AzxsHDjMA48?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_d617e060b7133aea5401c0d73edbabae":["1632164229"],"_oembed_4ba9cd2220e447854339cd9ed2c0e9c3":["{{unknown}}"],"_oembed_8f7288ccd1228336cd0cbad12f165507":["{{unknown}}"],"_oembed_f56bf1c5a64a315a94e4cbf7a197b2b0":["<iframe title=\"Integration between Astra theme and Toolset\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/z0GrsNVmFjo?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_f56bf1c5a64a315a94e4cbf7a197b2b0":["1639435970"],"_oembed_577d78b6b689a3008dd97c48d1c67d7e":["<iframe title=\"Translate Photo Gallery Using WPML [1\/2]\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/VPwP3Ng8czg?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_577d78b6b689a3008dd97c48d1c67d7e":["1644976656"],"_oembed_b908df960ca2342e997f9e8fea09015d":["<iframe title=\"Translate Photo Gallery Using WPML [2\/2]\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/2v37thlGvIA?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_b908df960ca2342e997f9e8fea09015d":["1644976656"],"_oembed_bbf56b1d4c25ce11481afba39f176f85":["<iframe title=\"Using WPML to translate content created with page builders\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/MSqNzrdPMkE?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_bbf56b1d4c25ce11481afba39f176f85":["1647185534"],"_oembed_bb1b191ac01b88ca66d2e8506a6c7792":["<iframe title=\"How to find a WPML Email with your Account Information\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/FD42SGp2h3U?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_bb1b191ac01b88ca66d2e8506a6c7792":["1667801995"],"_oembed_9d8f38350a62c2462b3bba4cd94fcb5c":["{{unknown}}"],"_oembed_2b752d957f9927f85cd3e8f1842c4adf":["{{unknown}}"],"_oembed_57975f4ba5c8952521d5c822cc574a95":["<iframe title=\"How to build a membership site in WordPress using Toolset plugins\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/7C1dFwxXME8?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>"],"_oembed_time_57975f4ba5c8952521d5c822cc574a95":["1672835100"],"_oembed_d812396ab00eaf7ff0dfe458721807c2":["<iframe title=\"Manual update to WPML 3.2\" width=\"525\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/4W2S7_pKOeI?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>"],"_oembed_time_d812396ab00eaf7ff0dfe458721807c2":["1688317367"],"_wpml_media_featured":["1"],"_wpml_media_duplicate":["0"],"_oembed_8b192c37df925cacb831b3922e69595d":["<iframe title=\"Using WPML To Translate Pages Built With Fusion Builder (Avada Theme)\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/_bNqjjBPdGA?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>"],"_oembed_time_8b192c37df925cacb831b3922e69595d":["1701199209"],"_oembed_a2bd2c0b8f2c628b1b3793abb74e7359":["<iframe title=\"WPML 3.9 with &quot;Display as Translated&quot; mode\" width=\"525\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/eiPUIuELo2A?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>"],"_oembed_time_a2bd2c0b8f2c628b1b3793abb74e7359":["1707748155"],"_oembed_bd297e209624e11355395418b468d409":["{{unknown}}"],"_oembed_b969b15ba299b2b428881df85710ac64":["{{unknown}}"],"_oembed_227c3996b88e71628d26d2b5e14f8801":["{{unknown}}"],"_oembed_1f5cf5f305b375c3d401f1389d439dd4":["{{unknown}}"],"_oembed_b78cc50d7b9c7f8dbe45ab06e4f197f3":["{{unknown}}"],"_oembed_6b3021705bcb82e7c808fbde89a28ab7":["{{unknown}}"],"_oembed_55b2ce6feeca37e2a2f801fd030a7a0e":["{{unknown}}"],"_oembed_9c93b11b6b2117647a155ea6e71a17fb":["{{unknown}}"],"_oembed_dce234ac33f8392c84df2abd41a9c8dd":["{{unknown}}"],"_oembed_eac9d1d34df027ef441b1fc841277bc3":["{{unknown}}"],"_oembed_75777a566b49ace7dde0ef94c52b5d90":["{{unknown}}"],"_oembed_29c3082e68d00dde23345b4b99ca0525":["{{unknown}}"],"_wpml_word_count":["1008"],"_uag_css_file_name":["uag-css-417.css"],"_uag_page_assets":["a:9:{s:3:\"css\";s:260:\".uag-blocks-common-selector{z-index:var(--z-index-desktop) !important}@media(max-width: 976px){.uag-blocks-common-selector{z-index:var(--z-index-tablet) !important}}@media(max-width: 767px){.uag-blocks-common-selector{z-index:var(--z-index-mobile) !important}}\";s:2:\"js\";s:0:\"\";s:18:\"current_block_list\";a:1:{i:0;s:14:\"core\/shortcode\";}s:8:\"uag_flag\";b:0;s:11:\"uag_version\";s:10:\"1778122249\";s:6:\"gfonts\";a:0:{}s:10:\"gfonts_url\";s:0:\"\";s:12:\"gfonts_files\";a:0:{}s:14:\"uag_faq_layout\";b:0;}"]},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"gform-image-choice-sm":false,"gform-image-choice-md":false,"gform-image-choice-lg":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false},"uagb_author_info":{"display_name":"Amir","author_link":"https:\/\/wpml.org\/zh-hans\/author\/admingm\/"},"uagb_comment_info":0,"uagb_excerpt":"I just had the pleasure of migrating this website from ...","_links":{"self":[{"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/posts\/417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/comments?post=417"}],"version-history":[{"count":8,"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/posts\/417\/revisions"}],"predecessor-version":[{"id":820,"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/posts\/417\/revisions\/820"}],"wp:attachment":[{"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/media?parent=417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/categories?post=417"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/tags?post=417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}