Playing the contents of .snap and .xlog files to a Tarantool instance
$ tt play URI FILE ... [OPTION ...]
tt play plays the contents of snapshot (.snap) and
WAL (.xlog) files to another Tarantool instance.
A single call of tt play can play multiple files.
-
-uUSERNAME,--usernameUSERNAME¶ A Tarantool user for connecting to the instance.
-
-pPASSWORD,--passwordPASSWORD¶ The user’s password.
-
--fromLSN¶ Play operations starting from the given LSN.
-
--toLSN¶ Play operations up to the given LSN. Default:
18446744073709551615.
-
--replicaID¶ Filter the operations by replica ID. Can be passed more than once.
When calling
tt catwith filters by LSN (--fromand--toflags) and replica ID (--replica), remember that LSNs differ across replicas. Thus, if you pass more than one replica ID via--fromor--to, the result may not reflect the actual sequence of operations.
-
--spaceID¶ Filter the output by space ID. Can be passed more than once.
-
--show-system¶ Show the operations on system spaces.
tt play plays operations from .xlog and .snap files to the destination
instance one by one. All data changes happen the same way as if they were performed
on this instance. This means that:
All affected spaces must exist on the destination instance. They must have the same structure and
space_idas on the instance that created the snapshot or WAL file.To play a snapshot or a WAL to a clean instance, include the operations on system spaces by adding the
--show-systemflag. With this flag,ttplays the operations that create and configure user-defined spaces.The operations“ LSNs change unless you play all operations that took place since the instance startup.
Replica IDs change in accordance with the destination instance configuration.
Use one of the following ways to pass the username and the password when connecting to the instance:
The
-u(--username) and-p(--password) options:$ tt play 192.168.10.10:3301 00000000000000000000.xlog -u myuser -p p4$$w0rD
The connection string:
$ tt play myuser:p4$$w0rD@192.168.10.10:3301 00000000000000000000.xlog
Environment variables
TT_CLI_USERNAMEandTT_CLI_PASSWORD:$ export TT_CLI_USERNAME=myuser $ export TT_CLI_PASSWORD=p4$$w0rD $ tt play 192.168.10.10:3301 00000000000000000000.xlog
Play the contents of
00000000000000000000.xlogto the instance on192.168.10.10:3301:$ tt play 192.168.10.10:3301 00000000000000000000.xlog
Play operations on spaces with
space_id512 and 513 from the00000000000000000012.snapsnapshot file:$ tt play 192.168.10.10:3301 00000000000000000012.snap --space 512 --space 513
Play the contents of
00000000000000000000.xlogincluding operations on system spaces:$ tt play 192.168.10.10:3301 00000000000000000000.xlog --show-system