From a1c8b3ab5b5db9924bcd4b4dd2a11b4cd887d5cd Mon Sep 17 00:00:00 2001 From: Laurel Michaels Date: Wed, 25 Mar 2015 11:21:20 -0400 Subject: [PATCH] Add migrated content for trove CLI chapter-4 This commit covers the backup_db_incremental section of section_cli_trove.xml Change-Id: I93caf4775fef30707e1bbc1351723dbe860eee55 Partial-Bug: #1419134 --- .../source/backup_db_incremental.rst | 124 ++++++++++++++++++ .../source/trove-manage-db.rst | 2 +- 2 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 doc/playground-user-guide/source/backup_db_incremental.rst diff --git a/doc/playground-user-guide/source/backup_db_incremental.rst b/doc/playground-user-guide/source/backup_db_incremental.rst new file mode 100644 index 0000000000..bf5c96c436 --- /dev/null +++ b/doc/playground-user-guide/source/backup_db_incremental.rst @@ -0,0 +1,124 @@ +======================= +Use incremental backups +======================= + +Incremental backups let you chain together a series of backups. You +start with a regular backup. Then, when you want to create a subsequent +incremental backup, you specify the parent backup. + +Restoring a database instance from an incremental backup is the same as +creating a database instance from a regular backup—the Database Service +handles the complexities of applying the chain of incremental backups. + +This example shows you how to use incremental backups with a MySQL +database. + +**Assumptions. **\ Assume that you have created a regular +backup for the following database instance: + +- Instance name: ``guest1`` + +- ID of the instance (``INSTANCE_ID``): + ``792a6a56-278f-4a01-9997-d997fa126370`` + +- ID of the regular backup artifact (``BACKUP_ID``): + ``6dc3a9b7-1f3e-4954-8582-3f2e4942cddd`` + +Create and use incremental backups +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +#. **Create your first incremental backup** + + Use the trove ``backup-create`` command and specify: + + - The ``INSTANCE_ID`` of the database instance you are doing the + incremental backup for (in this example, + ``792a6a56-278f-4a01-9997-d997fa126370``) + + - The name of the incremental backup you are creating: ``backup1.1`` + + - The ``BACKUP_ID`` of the parent backup. In this case, the parent + is the regular backup, with an ID of + ``6dc3a9b7-1f3e-4954-8582-3f2e4942cddd`` + + .. code:: + + $ trove backup-create INSTANCE_ID backup1.1 --parent BACKUP_ID + +-------------+--------------------------------------+ + | Property | Value | + +-------------+--------------------------------------+ + | created | 2014-03-19T14:09:13 | + | description | None | + | id | 1d474981-a006-4f62-b25f-43d7b8a7097e | + | instance_id | 792a6a56-278f-4a01-9997-d997fa126370 | + | locationRef | None | + | name | backup1.1 | + | parent_id | 6dc3a9b7-1f3e-4954-8582-3f2e4942cddd | + | size | None | + | status | NEW | + | updated | 2014-03-19T14:09:13 | + +-------------+--------------------------------------+ + + Note that this command returns both the ID of the database instance + you are incrementally backing up (``instance_id``) and a new ID for + the new incremental backup artifact you just created (``id``). + +#. **Create your second incremental backup** + + The name of your second incremental backup is ``backup1.2``. This + time, when you specify the parent, pass in the ID of the incremental + backup you just created in the previous step (``backup1.1``). In this + example, it is ``1d474981-a006-4f62-b25f-43d7b8a7097e``. + + .. code:: + + $ trove backup-create INSTANCE_ID backup1.2 --parent BACKUP_ID + +-------------+--------------------------------------+ + | Property | Value | + +-------------+--------------------------------------+ + | created | 2014-03-19T14:09:13 | + | description | None | + | id | bb84a240-668e-49b5-861e-6a98b67e7a1f | + | instance_id | 792a6a56-278f-4a01-9997-d997fa126370 | + | locationRef | None | + | name | backup1.2 | + | parent_id | 1d474981-a006-4f62-b25f-43d7b8a7097e | + | size | None | + | status | NEW | + | updated | 2014-03-19T14:09:13 | + +-------------+--------------------------------------+ + +#. **Restore using incremental backups** + + Now assume that your ``guest1`` database instance is damaged and you + need to restore it from your incremental backups. In this example, + you use the trove ``create`` command to create a new database + instance called ``guest2``. + + To incorporate your incremental backups, you simply use the + ``--backup`` parameter to pass in the ``BACKUP_ID`` of your most + recent incremental backup. The Database Service handles the + complexities of applying the chain of all previous incremental + backups. + + .. code:: + + $ trove create guest2 10 --size 1 --backup BACKUP_ID + +-------------------+-----------------------------------------------------------+ + | Property | Value | + +-------------------+-----------------------------------------------------------+ + | created | 2014-03-19T14:10:56 | + | datastore | {u'version': u'mysql-5.5', u'type': u'mysql'} | + | datastore_version | mysql-5.5 | + | flavor | {u'id': u'10', u'links': | + | | [{u'href': u'https://10.125.1.135:8779/v1.0/ | + | | 626734041baa4254ae316de52a20b390/flavors/10', u'rel': | + | | u'self'}, {u'href': u'https://10.125.1.135:8779/ | + | | flavors/10', u'rel': u'bookmark'}]} | + | id | a3680953-eea9-4cf2-918b-5b8e49d7e1b3 | + | name | guest2 | + | status | BUILD | + | updated | 2014-03-19T14:10:56 | + | volume | {u'size': 1} | + +-------------------+-----------------------------------------------------------+ + diff --git a/doc/playground-user-guide/source/trove-manage-db.rst b/doc/playground-user-guide/source/trove-manage-db.rst index 04477f57d3..e22c518660 100644 --- a/doc/playground-user-guide/source/trove-manage-db.rst +++ b/doc/playground-user-guide/source/trove-manage-db.rst @@ -11,10 +11,10 @@ handling complex administrative tasks. create_db.rst backup_db.rst + backup_db_incremental.rst .. TODO(lmichaels): As these files get converted, add them to the toctree: - - backup_db_incremental.rst - manage_db_config.rst - set_up_replication.rst - set_up_clustering.rst