Hello all, currently I have 3 org, dev, QA, and prod. I have made new inserts in a cloud data base table in the dev environment. Given that the same table in the QA org have the same 14 entries as the table in dev org, what would be the best practice to deploy the update from said table from the dev to QA org. Any help would be appreciated.
Discussion posts and replies are publicly visible
Hello edmondx0001
I recommend that while inserting data into the development environment, you create an SQL script. Please take note of it and run the same insert SQL script in the targeted environment's database with the proper timestamp. Manage those scripts for future reference.
Hi,
Creating SQL scripts of your database changes, backing up your QA database, running the scripts in QA, and verifying the updates before moving to production while using version control for script management is a best practice for deploying updates across environments.
If you are confident about the scripts that you have run in the dev, You can upload the same scripts in the package that you will be deploying to higher environment. Else, try taking a back up or complete export of what is there in the higher environment and then do the deployment for scripts. Also if its an insert statement with no primary keys, I would recommend updating the Scripts with the Primary keys and then proceeding with the deployment.
Hi edmondx0001 I would always recommend having a backup of your data when you are running scripts in the database. When you prepare scripts for your target Env, try running them a couple of times in dev and make sure your that your script gives you the expected output. Before deploying the scripts check the data in the target env take back up the data compare the data make necessary changes. Also, make sure if you are using any conditions they should not affect other data in your table
Hi edmondx0001,When you deal with database scripts either in manual or automation scripts, I recommend using idempotent SQL Scripts as per Database best practices for deployment, which can be call as rerunnable script. These scripts can be used for creating table, alter, create view and other scripts use of which of information_schema. This will use be useful when you use third party automation pipelines. As per your problem statement i recommend you use replace keyword instead of insert.below is example of idempotent sql script.