Hacker News new | past | comments | ask | show | jobs | submit login

One cool trick is that, after you've copied all the data to a new database, you offset the auto-increment to some larger value on all tables in the new DB. Then you can switch the old app to use the new DB and it will immediately start inserting new records into it, but will have a gap between the old and the new auto-incrementing values. If your app was getting a lot of writes you've probably ended up with a few extra rows in the old DB since it took you some time to copy the data over before you could switch the DB connection. However it's no problem since you've created that gap, so you can just copy the missing rows into the new DB later, there will be no collisions.



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: