The MU forums have moved to WordPress.org

How to import data to MU from another WP (22 posts)

  1. guarriman
    Member
    Posted 17 years ago #

    Hi.

    I've just installed WP-MU v1.0 and would like to import contents from another WP (v2.0) I've got.

    Is there any tutorial to do it? I've been searching for info, but I only found a pair of forum threads.

    Thank you very much.

  2. andrea_r
    Moderator
    Posted 17 years ago #

    That would be it.

  3. drmike
    Member
    Posted 17 years ago #

    But just in case: FAQ from wp.com land.

    Not sure what you searched for but when I tried import, that link came right up for me a few times.

  4. stinkypup
    Member
    Posted 17 years ago #

    If anyone gets this working, please post what you did.

    So far I've used phpMyadmin to export WP 2.0.7 tables into an xml file. I can read these tables to confirm they're in xml format.

    Then, I've logged into my mu blog and went to Manage=>Import
    and selected the file. The import completes, however no data is actually imported.

    Error msg in apache error_log file is:

    [Wed Feb 07 11:22:58 2007] [error] PHP Warning: Invalid argument supplied for foreach() in /usr/local/apache2/htdocs/blogs/wp-admin/import/wordpress.php on line 117

    Line 117 is:
    foreach ($_POST['user'] as $key => $line) {

    I tried importing tables individually, but this didn't work. I've tried exporting each table as an sql file and importing via phpMyAdmin, but am getting errors.

  5. BobSP
    Member
    Posted 17 years ago #

    I've not tried it with 2.0.7, but I just moved my 2.1 blog to mu1.0 by simply creating a new database and moving the tables across.

    I deleted the old blog and uploaded/installed the MU script. Then I went into phpmyadmin and moved the following tables (wp_categories, wp_comments, wp_link2cat, wp_links, wp_post2cat, wp_postmeta, wp_posts) to the relevant wp_2_** tables (after empting these tables so there was no conflicts with existing data).

    Of course that wasn't to the main blog on the MU install, that was to a second one i created. If your putting all your posts into the main MU blog change wp_2_** to wp_1_**.

    Sorry I'm not the best for describing stuff, but it worked a treat for me.

  6. drmike
    Member
    Posted 17 years ago #

    If anyone gets this working, please post what you did.

    Could have sworn that that's exactly what I did in the post directly above yours. *sigh*

  7. edmicman
    Member
    Posted 17 years ago #

    What about moving files and uploaded files from a WP2.0 installation to WPmu? Any tips for that?

  8. stinkypup
    Member
    Posted 17 years ago #

    1. Upgrade all old WP blogs to 2.1. You MUST upgrade.
    2. Export each WP blog
    3. Create the new blog in WP MU
    4. Import the each WPxxxx.xml file into each new WP MU blog.
    5. You may have to manually fix the ownership of postings.
    6. For categories, I used myphpadmin to export and insert query. Then I modified the insert query table to the appropriate table-- for example, instead if INSERT into wp_categories, use: INSERT into wp_8_categories.
    7. When fooling around with sql statements, you may have to compare the old wp table to the new wp MU table to ensure the same fields exist in both tables.

  9. drmike
    Member
    Posted 17 years ago #

    1) Why? The 2.0.x line has an exporter. It's easier to export out if you're up at 2.1 but this isn't a requirement.

    5) No you don't. It will ask you about ownership during the importing process.

    6) Nope, does it automatically.

  10. edmicman
    Member
    Posted 17 years ago #

    I ended up upgrading my WP2.0 to 2.1 before migrating - I read that the database structures changed between versions, so 2.1 would correspond more closely with MU1.0.

    However, exporting and importing didn't work. The export worked fine, but when I tried to import, it said the file was too large to be uploaded. Something about a PHP setting, which I could probably look into if I needed too. I did this instead:

    On my WP2.1 (was 2.0.x) blog, I used phpmyadmin to generate a SQL script for the blogs database. I changed all of the wp_ tables to wp_x_ where x was the corresponding blog number on the MU1.0 install. I also had to change some wbe addresses, image locations, etc. in the SQL script...it took a few tries of importing that script into the MU1.0 database before I got it right.

    For moving uploaded files, the file structure in MU is created under the blogs.dir directory. I had to move my uploaded WP2.1 files to that directory (I also had to have my host give me permissions for it, as WP sets the permissions to apache, and I couldn't get at it to create folders, etc.). After I moved the files (which also corresponded to paths in the SQL script), they showed up in posts, but don't display in the uploads manager in MU. Ah well, it's close, right?

    Good luck!

  11. lunabyte
    Member
    Posted 17 years ago #

    2.0.x "does" have an exporter, but, the question is the DB structure.

    Especially for pages, as they were changed a bit in the db in 2.1.

    Upgrading to 2.1 first, makes the changes to the db structure, at least it should be if I remember right.

    The downside of not upgrading first is that your pages will be all jacked up, and you'll have to edit the db manually for each page.

  12. eshepard
    Member
    Posted 17 years ago #

    Where would one find this 2.0.x exporter?

  13. lunabyte
    Member
    Posted 17 years ago #

    Upgrade to the current WP version first, and save the headaches.

  14. stormerider
    Member
    Posted 17 years ago #

    5) No you don't. It will ask you about ownership during the importing process.

    Actually, I just did this. Updated a blog from WP2.0.3 to 2.1.2 and did an export. Created the users in WPMU1.1.1 (SVNr906). Did an import, assigned the users to the posts. All of the posts ended up being owned by me. There was a foreach error during the import that I didn't track down at the time, but just a heads up that it's not 100% correct.

  15. joelp
    Member
    Posted 16 years ago #

    I ran into the same problem as stormerider. I exported posts and authors from TypePad, imported into WPMU. Import showed me the names of the authors of all posts, so I could see that they came across from the export. I completed the import and when it was done, all posts were authoerd by admin.

  16. andyket
    Member
    Posted 16 years ago #

    Hi, I have the same problem as stormerider and joelp.
    Importing entries from
    - a WP 2.1 install (WP export format)
    - a 3.33 MT install (MT export format)
    works fine, but although the names seem to be recognized, all posts end up being written by the admin.

    Is this a bug, or a permission issue, or something else?

    Anybody? Thanks in advance.

  17. andyket
    Member
    Posted 16 years ago #

    Is this forum very much alive? I don't have the impression it is...

    Nobody having an idea of how to solve my problem? Or is it a more serious bug?

  18. gentry
    Member
    Posted 16 years ago #

    I've got exactly the same problem when importing from a standalone wp 2.2 installation. The error is:

    Warning: Invalid argument supplied for foreach() in C:\www\webroot\wordpressmu\wp-admin\import\wordpress.php on line 104

    Line 104 in wordpress.php is:

    foreach ($_POST['user'] as $key => $line) {

    I've poked around a bit but can't figure out what isn't working... maybe someone else smarter than me knows?

  19. dbuttric
    Member
    Posted 16 years ago #

    I too am having the same problem. I can import the contents of the blog, but the categories, and the authors do not map to the ones set up in WPMU.

    I guess my question is is the simple solution to do the database moving, as metioned earlier?

    Or should we continue to to try the export, and import?

    Can someone shed some light on why the problems are happenning anyway? i looked at the category mapping problem, and I edited the code, to do what I thought was the right thing, but that just made all my tags turn into categories.

    Anyway, again, any help that anyone can provide here is greatly appreciates, like I said, maybe its just easier to do the database moving - that seems like a real timesaver.

    David

  20. Torley
    Member
    Posted 16 years ago #

    Happy I found this! I'm having a very similiar problem to stormerider, joelp, andyket, gentry, and dbuttric. In my case, I tried a test export from a group blog on WordPress.com and tried to import it into a WordPress MU 1.2.1 installation, selecting the right authors to remap to, but everyone gets remapped to the "admin".

  21. pampfelimetten
    Member
    Posted 16 years ago #

    same problem here: 170 admin posts instead split on 20 users...

  22. lunabyte
    Member
    Posted 16 years ago #

    Yep. Been an ongoing issue, really. However, the import functions are part of the WP trunk, and not specific to MU.

    Best to add a ticket to the main WP trac.

About this Topic

  • Started 17 years ago by guarriman
  • Latest reply from lunabyte