By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Save and restore RDS PostgreSql

0

Hello, I have enable AWS Backup for RDS database but i need to backup sql file out of AWS. For this purpose i have setup a bash script to backup and another to restore the file but when. Even if i backup or restore the file, i'm not able to see opération on RDS log. When i look into the table in the database after a restore i don't see any changes. did you have any idea about this?

asked 8 days ago26 views
3 Answers
1

Hi,

Did you confirm that you are not (still) in a "lazy loading" situation where restore in still under way: see tbis blog post https://aws.amazon.com/blogs/database/amazon-rds-snapshot-restore-and-recovery-demystified/

Reference docs details it here: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RestoreFromSnapshot.html

If you db is big, that may well be the case: restore is still under way!

Best,

Didier

profile pictureAWS
EXPERT
answered 8 days ago
profile picture
EXPERT
reviewed 7 days ago
  • I have a backup with RDS native backup solution that is working very well. The backup who has the problem is the one that is turning with bash script outside of AWS for a need to have an external sql file.

0

It seems like you're encountering issues with backing up and restoring your RDS PostgreSQL database using custom scripts outside of AWS's native backup mechanisms. There are a few important points to consider:

  1. AWS Backup for RDS: This is the native AWS solution for backing up RDS databases. It creates automated backups and allows for point-in-time recovery within the AWS ecosystem. However, this doesn't generate SQL files that you can access directly.

  2. Custom backup scripts: If you're using custom bash scripts to create SQL dumps of your database, these operations are performed at the application level and not at the RDS instance level. This is why you don't see these operations in the RDS logs.

  3. Restoring from SQL files: When you restore from SQL files using your custom scripts, you're likely executing SQL commands against the database. If you're not seeing changes in your tables after a restore operation, there could be several reasons:

    • The restore script might not be executing successfully.
    • The connection to the database might not be established correctly.
    • The SQL commands in your restore file might not be correct or might be failing silently.
    • You might be looking at the wrong database or schema after the restore.

To troubleshoot this:

  1. Check your backup and restore scripts for any errors.
  2. Ensure your scripts are connecting to the correct RDS instance and database.
  3. Add error checking and logging to your scripts to capture any issues during execution.
  4. Try restoring a small amount of data first and verify the changes immediately after.
  5. Check the PostgreSQL logs on your RDS instance for any error messages related to your restore operations.

Remember that while custom backup solutions can be useful, they don't integrate with RDS's native backup and restore mechanisms. For critical data, it's recommended to use AWS's native backup solutions in conjunction with your custom scripts for additional data protection.
Sources
Restore an RDS database - AWS Backup
Backup and recovery for Amazon RDS - AWS Prescriptive Guidance

profile picture
answered 8 days ago
profile picture
EXPERT
reviewed 8 days ago
  • Hello i will try to look at postgresql log to see the errors or on the script and i will give you a feedback

0

Can you please describe what you're doing in your backup and restore scripts more in detail?

AWS
answered 8 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions