Commiting containers with data (container snapshots)
A container with associated cloned data can be modified by a user and then snapshotted (or committed) to create a new image. This functionality is available for SQL Server and Oracle in the Enterprise Plus edition of Windocks. A developer working on their container can make modifications to the data. When work is complete, the developer can commit the container with the data to create an an image in seconds (no matter how big the data).
Create a container from an image that has data (See this to build the image). Use the web app or REST API to create a container with data or run the command below:docker run -d yourImageName
Make changes to the data in the container and commit the container with the data. Use the web app (Go to Containers and clones, find your container, type in a new image name and click Snapshot). Or use the docker commit REST api. Or run the command line below.docker commit YourContainerId FreshImageName
Create a container from the fresh image which has a writeable database clone. Use the web app or REST API to create a container with data or run the command below:docker run -d FreshImageName
The new container includes an exact copy of the previously committed container. The commit and both runs are completed in seconds even if the database is terabytes in size. You may further commit this container and then create another image and so on.
Production database point in time snapshots, roll-back
Windocks provides users with database clones from varied production point in time snapshots, allowing users to roll forward and backward on an production image timeline. This functionality is available for SQL Server and Oracle in the Windocks Enterprise Plus edition. Users get roll back and roll forward functionality.
SQL Server production point-in-time snapshots
Windocks incrementally refreshes SQL Server images with production changes using transaction log backups. As each set of transaction log backups is applied, Windocks automatically creates an instantaneous snapshot of the image. This results in a timeline of snapshots for past days / months which reflect production as of those times. Database clones can be instantly created from these snapshots.
Step 1: Setup configuration for creating snapshots.
Open the file windocks\config\node.conf and make changes so that the lines look like below.
# FULL_BACKUPS_ONLY="1"
CREATE_RESTORE_POINTS="1"
DATETIME_FORMAT_FOR_SNAPSHOT_NAMES="yyyy_MM_dd_HHmm"
Step 2: Restart the Windocks service
Step 3: Build an image that supports incremental refreshes from production.
See how to build incremental refresh images.
Or use the sample in windocks\samples\\incrementalRefreshWithTransactionLogBackups. Make changes to the dockerfile in this directory for your SQL version and backup path and then build the image with the Web App (Click Build on the top menu) or use the command line
cd windocks\samples\\incrementalRefreshWithTransactionLogBackups
docker build -t freshImage .
Step 4: Apply the first transaction log backup or set of backups.
Use the web app (Click Refresh on the top menu and provide the path to the backup) or use the command line:
docker exec freshImage path\to\trans1.trn
or if you want to apply multiple transaction log backups,
docker exec freshImage path\to\directory\containing\log\backups
Step 5: See the image snapshot
Use the web app (click on Images on the top menu, find freshImage and click on it. Scroll to the bottom and see the snapshot that was created). This snapshot represents the state of the database as of the time of the transaction log backup application.
Step 6: Apply more transaction log backups.
Repeat step 4 with the next set of transaction log backups and view the new snapshots as described in step 5. As you apply more transaction log backups, you will have a timeline of image snapshots that represent different production database states over time
Step 7: Create containers from these snapshots
Use the web app (click on Images on the top menu, find freshImage and click on it. Scroll to the bottom and see the snapshots). Put in a container name next to the snapshot name and click Deliver. Repeat for a couple of snapshots. See the containers in Containers and Clones (top menu) and see the different states of data in those containers.
You may also use the REST API for each of the above steps as described here.