Getting WordPress images into the Media Library after migration












1















I am moving from one WordPress host to another. I'm stuck at getting migrated images to show up in the media library.



This is what I did:




  • I zipped and downloaded all the files in the wp-content/uploads folder and then unzipped them into the new server's upload directory.

  • I exported the wp_posts data:select * from wp_posts where post_type='attachment' and all the wp_postmeta with those post_id's.

  • I did a search and replace in the SQL files to update the domain name.

  • None of those wp_posts.ID or wp_postmeta.meta_id's conflicted with the new database, so I imported the SQL files.


The data is in the tables, but still nothing is showing up in the media library. The date filter drop down list in the Media Library is showing all the months for the folders, but it's not showing any images "No Media Files Found".



The images are in the right place, since the page builder I'm using is showing all the images properly (with the new domain name in their URLs).



Is there an extra step I'm missing to get the images on the new server to show up in the media library?










share|improve this question





























    1















    I am moving from one WordPress host to another. I'm stuck at getting migrated images to show up in the media library.



    This is what I did:




    • I zipped and downloaded all the files in the wp-content/uploads folder and then unzipped them into the new server's upload directory.

    • I exported the wp_posts data:select * from wp_posts where post_type='attachment' and all the wp_postmeta with those post_id's.

    • I did a search and replace in the SQL files to update the domain name.

    • None of those wp_posts.ID or wp_postmeta.meta_id's conflicted with the new database, so I imported the SQL files.


    The data is in the tables, but still nothing is showing up in the media library. The date filter drop down list in the Media Library is showing all the months for the folders, but it's not showing any images "No Media Files Found".



    The images are in the right place, since the page builder I'm using is showing all the images properly (with the new domain name in their URLs).



    Is there an extra step I'm missing to get the images on the new server to show up in the media library?










    share|improve this question



























      1












      1








      1


      1






      I am moving from one WordPress host to another. I'm stuck at getting migrated images to show up in the media library.



      This is what I did:




      • I zipped and downloaded all the files in the wp-content/uploads folder and then unzipped them into the new server's upload directory.

      • I exported the wp_posts data:select * from wp_posts where post_type='attachment' and all the wp_postmeta with those post_id's.

      • I did a search and replace in the SQL files to update the domain name.

      • None of those wp_posts.ID or wp_postmeta.meta_id's conflicted with the new database, so I imported the SQL files.


      The data is in the tables, but still nothing is showing up in the media library. The date filter drop down list in the Media Library is showing all the months for the folders, but it's not showing any images "No Media Files Found".



      The images are in the right place, since the page builder I'm using is showing all the images properly (with the new domain name in their URLs).



      Is there an extra step I'm missing to get the images on the new server to show up in the media library?










      share|improve this question
















      I am moving from one WordPress host to another. I'm stuck at getting migrated images to show up in the media library.



      This is what I did:




      • I zipped and downloaded all the files in the wp-content/uploads folder and then unzipped them into the new server's upload directory.

      • I exported the wp_posts data:select * from wp_posts where post_type='attachment' and all the wp_postmeta with those post_id's.

      • I did a search and replace in the SQL files to update the domain name.

      • None of those wp_posts.ID or wp_postmeta.meta_id's conflicted with the new database, so I imported the SQL files.


      The data is in the tables, but still nothing is showing up in the media library. The date filter drop down list in the Media Library is showing all the months for the folders, but it's not showing any images "No Media Files Found".



      The images are in the right place, since the page builder I'm using is showing all the images properly (with the new domain name in their URLs).



      Is there an extra step I'm missing to get the images on the new server to show up in the media library?







      mysql wordpress image media






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 20 at 8:09







      ZRM

















      asked Jan 20 at 6:58









      ZRMZRM

      64




      64
























          2 Answers
          2






          active

          oldest

          votes


















          0














          You do not need the export the wp_post data or wp_postmeta.



          Here's how I migrate my websites manually:




          1. Export the whole database and download the files.

          2. Import the whole database and copy the files on the root folder.


          3. Then on your phpmyadmin and run these scripts, select wp_options table:



            UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl',
            'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';




            1. On the wp_posts table run these:


            UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');



            UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');




            1. On wp_postmeta table run this:


            UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');




          Make sure to change the urls. This will fix the images and other media that are not showing because the url is broken or your site is showing the old url.






          share|improve this answer
























          • Thanks, but I'm just trying to export/import only pages and media. I don't want anything else overwritten.

            – ZRM
            Jan 20 at 18:03











          • If that's the case. You can export data from wordpress dashboard. Go to Wp Dashboard->Tools->Export. Select the data you want to export then download. You will get the xml file. Then import the xml file to the new website under Tool->Import.

            – Romel Indemne
            Jan 21 at 4:42



















          0














          The easiest way to migrate to another host and keep the links and images intact is to use the plugin called All in One WP Migration



          The Step to follow is:




          1. Install the plugin on your website

          2. Create a backup, the result will be .wpress, download it

          3. In the new host, install a clean copy of WP

          4. Install the plugin on this new website

          5. Import the .wpress backup


          This will tell you that all data of your new installation will be replaced by the one from your previous host but all links will be updated. So old-domain.com will be replaced by new-domain.com without making changes anywhere (database or content).



          Tested this many times so I know it works well. There is a reason why it has 1+M downloads.






          share|improve this answer


























          • Thanks. But I only want to migrate pages and images and not any other data.

            – ZRM
            Jan 20 at 16:33











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54274278%2fgetting-wordpress-images-into-the-media-library-after-migration%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You do not need the export the wp_post data or wp_postmeta.



          Here's how I migrate my websites manually:




          1. Export the whole database and download the files.

          2. Import the whole database and copy the files on the root folder.


          3. Then on your phpmyadmin and run these scripts, select wp_options table:



            UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl',
            'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';




            1. On the wp_posts table run these:


            UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');



            UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');




            1. On wp_postmeta table run this:


            UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');




          Make sure to change the urls. This will fix the images and other media that are not showing because the url is broken or your site is showing the old url.






          share|improve this answer
























          • Thanks, but I'm just trying to export/import only pages and media. I don't want anything else overwritten.

            – ZRM
            Jan 20 at 18:03











          • If that's the case. You can export data from wordpress dashboard. Go to Wp Dashboard->Tools->Export. Select the data you want to export then download. You will get the xml file. Then import the xml file to the new website under Tool->Import.

            – Romel Indemne
            Jan 21 at 4:42
















          0














          You do not need the export the wp_post data or wp_postmeta.



          Here's how I migrate my websites manually:




          1. Export the whole database and download the files.

          2. Import the whole database and copy the files on the root folder.


          3. Then on your phpmyadmin and run these scripts, select wp_options table:



            UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl',
            'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';




            1. On the wp_posts table run these:


            UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');



            UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');




            1. On wp_postmeta table run this:


            UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');




          Make sure to change the urls. This will fix the images and other media that are not showing because the url is broken or your site is showing the old url.






          share|improve this answer
























          • Thanks, but I'm just trying to export/import only pages and media. I don't want anything else overwritten.

            – ZRM
            Jan 20 at 18:03











          • If that's the case. You can export data from wordpress dashboard. Go to Wp Dashboard->Tools->Export. Select the data you want to export then download. You will get the xml file. Then import the xml file to the new website under Tool->Import.

            – Romel Indemne
            Jan 21 at 4:42














          0












          0








          0







          You do not need the export the wp_post data or wp_postmeta.



          Here's how I migrate my websites manually:




          1. Export the whole database and download the files.

          2. Import the whole database and copy the files on the root folder.


          3. Then on your phpmyadmin and run these scripts, select wp_options table:



            UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl',
            'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';




            1. On the wp_posts table run these:


            UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');



            UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');




            1. On wp_postmeta table run this:


            UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');




          Make sure to change the urls. This will fix the images and other media that are not showing because the url is broken or your site is showing the old url.






          share|improve this answer













          You do not need the export the wp_post data or wp_postmeta.



          Here's how I migrate my websites manually:




          1. Export the whole database and download the files.

          2. Import the whole database and copy the files on the root folder.


          3. Then on your phpmyadmin and run these scripts, select wp_options table:



            UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl',
            'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';




            1. On the wp_posts table run these:


            UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');



            UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');




            1. On wp_postmeta table run this:


            UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');




          Make sure to change the urls. This will fix the images and other media that are not showing because the url is broken or your site is showing the old url.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 20 at 12:10









          Romel IndemneRomel Indemne

          1495




          1495













          • Thanks, but I'm just trying to export/import only pages and media. I don't want anything else overwritten.

            – ZRM
            Jan 20 at 18:03











          • If that's the case. You can export data from wordpress dashboard. Go to Wp Dashboard->Tools->Export. Select the data you want to export then download. You will get the xml file. Then import the xml file to the new website under Tool->Import.

            – Romel Indemne
            Jan 21 at 4:42



















          • Thanks, but I'm just trying to export/import only pages and media. I don't want anything else overwritten.

            – ZRM
            Jan 20 at 18:03











          • If that's the case. You can export data from wordpress dashboard. Go to Wp Dashboard->Tools->Export. Select the data you want to export then download. You will get the xml file. Then import the xml file to the new website under Tool->Import.

            – Romel Indemne
            Jan 21 at 4:42

















          Thanks, but I'm just trying to export/import only pages and media. I don't want anything else overwritten.

          – ZRM
          Jan 20 at 18:03





          Thanks, but I'm just trying to export/import only pages and media. I don't want anything else overwritten.

          – ZRM
          Jan 20 at 18:03













          If that's the case. You can export data from wordpress dashboard. Go to Wp Dashboard->Tools->Export. Select the data you want to export then download. You will get the xml file. Then import the xml file to the new website under Tool->Import.

          – Romel Indemne
          Jan 21 at 4:42





          If that's the case. You can export data from wordpress dashboard. Go to Wp Dashboard->Tools->Export. Select the data you want to export then download. You will get the xml file. Then import the xml file to the new website under Tool->Import.

          – Romel Indemne
          Jan 21 at 4:42













          0














          The easiest way to migrate to another host and keep the links and images intact is to use the plugin called All in One WP Migration



          The Step to follow is:




          1. Install the plugin on your website

          2. Create a backup, the result will be .wpress, download it

          3. In the new host, install a clean copy of WP

          4. Install the plugin on this new website

          5. Import the .wpress backup


          This will tell you that all data of your new installation will be replaced by the one from your previous host but all links will be updated. So old-domain.com will be replaced by new-domain.com without making changes anywhere (database or content).



          Tested this many times so I know it works well. There is a reason why it has 1+M downloads.






          share|improve this answer


























          • Thanks. But I only want to migrate pages and images and not any other data.

            – ZRM
            Jan 20 at 16:33
















          0














          The easiest way to migrate to another host and keep the links and images intact is to use the plugin called All in One WP Migration



          The Step to follow is:




          1. Install the plugin on your website

          2. Create a backup, the result will be .wpress, download it

          3. In the new host, install a clean copy of WP

          4. Install the plugin on this new website

          5. Import the .wpress backup


          This will tell you that all data of your new installation will be replaced by the one from your previous host but all links will be updated. So old-domain.com will be replaced by new-domain.com without making changes anywhere (database or content).



          Tested this many times so I know it works well. There is a reason why it has 1+M downloads.






          share|improve this answer


























          • Thanks. But I only want to migrate pages and images and not any other data.

            – ZRM
            Jan 20 at 16:33














          0












          0








          0







          The easiest way to migrate to another host and keep the links and images intact is to use the plugin called All in One WP Migration



          The Step to follow is:




          1. Install the plugin on your website

          2. Create a backup, the result will be .wpress, download it

          3. In the new host, install a clean copy of WP

          4. Install the plugin on this new website

          5. Import the .wpress backup


          This will tell you that all data of your new installation will be replaced by the one from your previous host but all links will be updated. So old-domain.com will be replaced by new-domain.com without making changes anywhere (database or content).



          Tested this many times so I know it works well. There is a reason why it has 1+M downloads.






          share|improve this answer















          The easiest way to migrate to another host and keep the links and images intact is to use the plugin called All in One WP Migration



          The Step to follow is:




          1. Install the plugin on your website

          2. Create a backup, the result will be .wpress, download it

          3. In the new host, install a clean copy of WP

          4. Install the plugin on this new website

          5. Import the .wpress backup


          This will tell you that all data of your new installation will be replaced by the one from your previous host but all links will be updated. So old-domain.com will be replaced by new-domain.com without making changes anywhere (database or content).



          Tested this many times so I know it works well. There is a reason why it has 1+M downloads.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 20 at 15:53

























          answered Jan 20 at 15:47









          xDiffxDiff

          36724




          36724













          • Thanks. But I only want to migrate pages and images and not any other data.

            – ZRM
            Jan 20 at 16:33



















          • Thanks. But I only want to migrate pages and images and not any other data.

            – ZRM
            Jan 20 at 16:33

















          Thanks. But I only want to migrate pages and images and not any other data.

          – ZRM
          Jan 20 at 16:33





          Thanks. But I only want to migrate pages and images and not any other data.

          – ZRM
          Jan 20 at 16:33


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54274278%2fgetting-wordpress-images-into-the-media-library-after-migration%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Liquibase includeAll doesn't find base path

          How to use setInterval in EJS file?

          Petrus Granier-Deferre