Skip to main content
Skip table of contents

Taking a snapshot of the staging DB

Perform the following steps to take snapshots of the staging database.

  1. Create a staging database on the Delphix Continuous Data Engine mount path by copying files at o/s level or using tools like MongoDB OPS manager. Refer to any of the below methods to create a staging database.

    1. Create a new MongoDB database instance

      1. Create a new empty single member MongoDB replica set cluster using MongoDB Ops Manager or by any other tool/mechanism.

      2. Make sure to use the same Delphix Continuous Data Engine mount path used in dSource creation, appended with /s0m0, as the location for data files. Also, use the same port that was provided while creating a dSource.

      3. You can optionally restore any required data on this instance using mongorestore, custom scripts, or MongoDB Ops Manager.

      4. Update permissions of MongoDB files if any other user is used to create a MongoDB database instance.

    2. Use one of the following.

      CODE
      login as root
      su -m mongod -c 'chmod -R 775 /mnt/provision/stagingpush/s0m0'
      CODE
      login as mongod
      chmod -R 775 /mnt/provision/stagingpush/s0m0
  1. Create MongoDB secondary instance (nonsharded only)

    1. Create a new empty single member MongoDB replica set cluster.

    2. Make sure to use the same Delphix Continuous Data Engine mount path used in dSource creation, appended with /s0m0, as the location for data files. Also, use the same port that was provided while creating a dSource.

    3. Modify the source database replica set cluster using MongoDB OPS manager or manually add the newly created single node MongoDB replica set cluster (created above), as a hidden member to the existing source database replica set cluster.

    4. Set Votes = 0 and Priority = 0. This will ensure that this member never contributes in the election and never becomes primary.

    5. Once done, MongoDB source database instance will start replicating data from existing nodes to the newly created member.

  1. After the staging database is created successfully with the desired data, take a snapshot.

Additional notes

  • The initial snapshot that is created during the creation of a dSource includes an empty data directory located within the mount point created by the Delphix Continuous Data Engine. Consequently, creating Virtual Databases (VDBs) directly from this snapshot is not possible. Therefore, take a new snapshot manually when the staging database instance is created successfully.

  • The Delphix Continuous Data Engine always appends /s0m0 as a subfolder to the file system provided while creating staging push data ingestion type. For example, if /mnt/provision/stagingpush was provided as the mount point while creating a dSource, provide /mnt/provision/stagingpush/s0m0 as the data file location while creating the MongoDB Instance manually or via tools.

  • While restoring the backup using MongoDB Ops Manager or mongorestore, etc. make sure the /mnt/provision/stagingpush/s0m0/restoreInfo.txt file exists before taking a snapshot.

  • Replica Set field must be set in the /mnt/provision/stagingpush/s0m0/restoreInfo.txt file before taking a snapshot, as shown in the example below.

CODE
#cat restoreInfo.txt
Restore Information
Group Name: <Group name>
Replica Set: <Replica Set Name>
Snapshot timestamp: <as Timestamp at UTC>
Restore timestamp:  <as a BSON Timestamp at UTC>
Last Oplog Applied: <as a BSON Timestamp at UTC>
MongoDB Version: <MongoDB Version>
Storage Engine: <Storage engine type>
Startup Options: {}
Encryption: <Only appears if encryption is enabled on the snapshot>
keyEncryptionKey UUID: <Only appears if encryption is enabled on the snapshot>
Master Key UUID: <Only appears if encryption is enabled on the snapshot>
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.