Help - Search - Members - Calendar
Full Version: Import Archives With Id
Movable Type Community Forum > Additional Resources > Tips and Tricks
arminvit
Hello,

I am starting my blogs from scratch since I suffered from a corrupt BerkeleyDB, and now that I have gotten over it, I have one question.

I have an export log (mt.cgi file) of 1,200+ entries that each have their own archive ID, which is nicely specified in the log. For some reason (long story) my first post's ID is 1965. So when I start the new blog and import these entries I want them to keep their original ID. But instead the system imports my first entry in the log as ID 1, rather than ID 1965. Is there any way to force MT to import with the original IDs?

Thanks!
Armin
arminvit
In case anyone runs into this issue, here is the solution:

1. You are starting from scratch
2. You have a backup and an export of your entries
3. You use MySQL

(if none of these apply to you, you can stop reading)

4. Reinstall a fresh MT and create a new MySQL DB.
5. Create an import file from your exported mt.cgi that contains ONLY one entry, plus comments if you want.
6. Upload that file to mt/import
7. Go trough the typical import process
8. With PHPMyAdmin access your newly created database that should contain 18 thingies ("tables"? sorry, I'm new to MySQL and have little idea what is what – this means that if I can do it, you can do it).
6. Select "mt_entry" and Browse it
7. You should see the single entry that you imported.
8. Hit Edit on that.
9. Under entry_id change the value from 1 to x-1 number. Where "x" is the very first entry where you want to start the numbering. So for example: My first entry was 1965. So I changed this first exported entry from 1 to 1964. So that when you import all your entries it will start at 1965. You can then delete the 1964).
10. To do this, make sure that your mt_entry is set to auto_increment (I think it usually is by default.

And that's it!

Hope this is helpful for someone.
outskirts
QUOTE (arminvit @ Apr 16 2006, 03:00 PM) *
In case anyone runs into this issue, here is the solution:

1. You are starting from scratch
2. You have a backup and an export of your entries
3. You use MySQL

(if none of these apply to you, you can stop reading)

4. Reinstall a fresh MT and create a new MySQL DB.
5. Create an import file from your exported mt.cgi that contains ONLY one entry, plus comments if you want.
6. Upload that file to mt/import
7. Go trough the typical import process
8. With PHPMyAdmin access your newly created database that should contain 18 thingies ("tables"? sorry, I'm new to MySQL and have little idea what is what – this means that if I can do it, you can do it).
6. Select "mt_entry" and Browse it
7. You should see the single entry that you imported.
8. Hit Edit on that.
9. Under entry_id change the value from 1 to x-1 number. Where "x" is the very first entry where you want to start the numbering. So for example: My first entry was 1965. So I changed this first exported entry from 1 to 1964. So that when you import all your entries it will start at 1965. You can then delete the 1964).
10. To do this, make sure that your mt_entry is set to auto_increment (I think it usually is by default.

And that's it!

Hope this is helpful for someone.


I am going to try this, but a question first:

I have 2,300 entries on a weblog. I've set up a new installation of MT under a different domain name.
So now according to these instructions I have to import just one post to start. The earliest post on the weblog is number 5.
So I import that post, go into the database as instructed and change the newly imported post from number 1 to number 5.

Question: the next step is importing the rest of the entries. The numbers are not always contiguous. They run 5, 6, 7, 9, 12, 13,14,16 and so on. When I import the rest of the entries, will the change in the post numbers correspond? that is, I manually changed 1 to 5, but will happen to post 9, as there is no post 8?

Hope this is clear. Thanks for your help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.