Self-hosted database migration primary key sequence

I'm migrating tables from Retool's cloud to self-hosted instance. Following Retool's instructions, I had to export each table as CSV then reimport it to the self-hosted database. However, I realized that the serial behind the id primary key no longer exists when I import the data. It forces me to have to create the table from scratch, with each of its fields, before importing the data to retain the id sequence. Can someone advise if there's a faster way to just import the data and have the id sequence already there as the default value? If I try to type it in manually, it also throws an error (ex. import a table called "customers", the id default value is set to none, set the default value to customers_id_seq, Retool throws an error). This would save me a ton of time when migrating tables!

@tiffany I'm facing similar issues. I've had to do quite a bit of work in Google Sheets to recreate a lot of foreign key relationships etc.

I don't have a solution but I feel your pain!


1 Like