Question

I'm currently importing my users and forum posts to a new database. The problem is that the import script adds new user IDs since it has to generate the user information in different tables. But when I import the forum posts (manually) it goes after the old user IDs.

What do you suggest for a solution for this? I can't really get my head wrapped around this so that's why I'm asking!

EDIT: I use a pre-made script to import users and I import the forum posts manually.

Thanks!

No correct solution

OTHER TIPS

The quickest/easiest thing that I can think of (If you can not find another way of mapping forums to users), is to create a temporary_id (temp_id) column in your users table.

The temp_id will have the same values as the id (in the users table) and it will just be a INT column.

One you got that, you can then import stuff into your new DB. Then, write a script that will use temp_id to get the right forums for each user and update its id with the new users id.

Hope that helps

Change the script so it adds the user id's as a new column e.g. IDdel then manually copy the db structure + data for your id column from the old database to the new one. Run your import script, delete the IDdel column.

Should be all good.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top