Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Didn't migrate any data #11

Open
belle-chang opened this issue Feb 16, 2024 · 4 comments
Open

Didn't migrate any data #11

belle-chang opened this issue Feb 16, 2024 · 4 comments
Assignees
Labels
waiting-reply Waiting for the user to respond with more details

Comments

@belle-chang
Copy link

Hi,

I'm using your COLAB notebook for Migrate_Project_&_Storage.ipynb, but none of my data is actually copying to my tables in my new Supabase project. Is there anything I could be missing?

Thanks!

@mansueli mansueli self-assigned this Feb 16, 2024
@mansueli
Copy link
Owner

Hey @belle-chang, can you share the logs that you got?

Either the logs file or the output after running the last part of the colab.

@mansueli mansueli added the waiting-reply Waiting for the user to respond with more details label Feb 16, 2024
@belle-chang
Copy link
Author

belle-chang commented Feb 16, 2024

Hey! I realized what the issue was - it's not doing any of the insertions because I had some key constraints and relationships in my DB. I had to add this to the beginning of the script:

# Create a temporary file to store the modified data dump
tmpfile=$(mktemp)

# Insert the line at the beginning of the data_dump.sql file
# This is NECESSARY -- it allows insertion even if there are key constraints
echo 'SET session_replication_role = replica;' > "$tmpfile"
mv "$tmpfile" data_dump.sql

Alternatively you can manually add SET session_replication_role = replica; to the beginning of the data_dump.sql file. Then, when saving to data_dump.sql, I used >>.

@mansueli mansueli removed the waiting-reply Waiting for the user to respond with more details label Feb 16, 2024
@belle-chang belle-chang reopened this Feb 16, 2024
@belle-chang
Copy link
Author

Sorry, another question. I'm noticing that not all my storage objects are being moved over with the script. I am only getting about 270 of the 2300 records in my table I'm trying to back up. Is there something I'm missing here? The policies for the table are on anon.

@mansueli
Copy link
Owner

Thanks for getting back to us. I am not sure, can you edit the script to be in debug mode?

Add a block with this code below above the block Running migration & moving storage objects: and run it:

!pip install logging
from logging import basicConfig, DEBUG
basicConfig(level=DEBUG)

Then, you'll be able to get more verbose logs to understand what is happening there.

@mansueli mansueli added the waiting-reply Waiting for the user to respond with more details label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-reply Waiting for the user to respond with more details
Projects
None yet
Development

No branches or pull requests

2 participants