forked from docs/doc-exports
Reviewed-by: Liudmila Denisova <ldenisov@noreply.gitea.eco.tsi-dev.otc-service.com> Co-authored-by: chenjunjie <chenjunjie@huawei.com> Co-committed-by: chenjunjie <chenjunjie@huawei.com>
40 lines
16 KiB
HTML
40 lines
16 KiB
HTML
<a name="dcs-migration-190703002"></a><a name="dcs-migration-190703002"></a>
|
|
|
|
<h1 class="topictitle1">Self-Hosted Redis Migration with Backup Files</h1>
|
|
<div id="body1562138749036"><p id="dcs-migration-190703002__p592264013322">This section describes how to migrate self-hosted Redis to DCS by importing backup files.</p>
|
|
<p id="dcs-migration-190703002__p542904425717">Simply download the source Redis data and then upload the data to an OBS bucket in the same account and region as the target DCS Redis instance. After you have created a migration task on the DCS console, DCS will read data from the OBS bucket and data will be migrated to the target instance.</p>
|
|
<div class="section" id="dcs-migration-190703002__section025432520201"><h4 class="sectiontitle">Notes and Constraints</h4><ul id="dcs-migration-190703002__en-us_topic_0000001893744560_ul365114368261"><li id="dcs-migration-190703002__en-us_topic_0000001893744560_li5651123602613">To migrate to an instance with SSL enabled, disable the SSL setting first. For details, see <a href="dcs-ug-023129.html">Transmitting DCS Redis Data with Encryption Using SSL</a>.</li><li id="dcs-migration-190703002__en-us_topic_0000001893744560_li96511336112619">Migration may fail if the target instance uses smaller specifications than its source.</li></ul>
|
|
</div>
|
|
<div class="section" id="dcs-migration-190703002__section393611177"><a name="dcs-migration-190703002__section393611177"></a><a name="section393611177"></a><h4 class="sectiontitle">Prerequisites</h4><ul id="dcs-migration-190703002__ul20616194735711"><li id="dcs-migration-190703002__li1953741872914">Before migrating data, read through <a href="dcs-migration-090626002.html">Migration Solution Notes</a> to learn about the DCS data migration function and select an appropriate target instance.</li><li id="dcs-migration-190703002__li17389364337">By default, a cluster instance has only one DB (DB0). Before you migrate data from a multi-DB single-node or master/standby instance to a Redis Cluster instance, check whether any data exists on databases other than DB0. To ensure that the migration succeeds, move all data to DB0 by referring to <a href="dcs-migration-090626001_0.html">Online Migration from Another Cloud Using Rump</a>.</li><li id="dcs-migration-190703002__li16161947155711">Prepare the source Redis backup file. The backup file must be in .aof, .rdb, .zip, or .tar.gz format.</li><li id="dcs-migration-190703002__li20949052135714">If a target DCS Redis instance is not available, create one first. For details, see <a href="dcs-ug-0312003.html">Creating a DCS Redis Instance</a>.</li><li id="dcs-migration-190703002__li125429292588">If you already have a DCS Redis instance, you do not need to create one again. For comparing migration data and reserving sufficient memory, you are advised to clear the instance data before the migration. For details, see <a href="dcs-ug-0312018.html">Clearing DCS Instance Data</a>. If any data exists on the target instance, duplicate data between the source and target is overwritten. If the data exists only on the target instance, the data will be retained.</li></ul>
|
|
</div>
|
|
<div class="section" id="dcs-migration-190703002__section119981132024"><h4 class="sectiontitle">Creating an OBS Bucket and Uploading Backup Files</h4><ol id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_ol14268144310394"><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li526813435394"><span>Create an OBS bucket.</span><p><ol type="a" id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_ol1428871018424"><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li928820103427">Log in to the OBS Console and click <strong id="dcs-migration-190703002__dcs-ug-0312037_b166887291556">Create Bucket</strong>.</li><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li67334415810">Select a region.<p id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_p6758547101115"><a name="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li67334415810"></a><a name="dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li67334415810"></a>The OBS bucket must be in the same region as the target DCS Redis instance.</p>
|
|
</li><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li17551201611127">Specify <strong id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_b35011159155518">Bucket Name</strong>.<p id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_p13756232101216">The bucket name must meet the naming rules specified on the console.</p>
|
|
</li><li id="dcs-migration-190703002__dcs-ug-0312037_li7374556111414">Set <strong id="dcs-migration-190703002__dcs-ug-0312037_b6855154112512">Storage Class</strong> to <strong id="dcs-migration-190703002__dcs-ug-0312037_b4856246254">Standard</strong>, <strong id="dcs-migration-190703002__dcs-ug-0312037_b15857194162510">Warm</strong> or <strong id="dcs-migration-190703002__dcs-ug-0312037_b8857184172513">Cold</strong>.</li><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li1599313751414">Set <strong id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_b106244293384">Bucket Policy</strong> to <strong id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_b16228222115810">Private</strong>, <strong id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_b288452010585">Public Read</strong>, or <strong id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_b48751517175816">Public Read and Write</strong>.</li><li id="dcs-migration-190703002__dcs-ug-0312037_li8943153811198">Configure default encryption.</li><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li1095473710153">Click <strong id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_b27676134598">Create Now</strong>.</li></ol>
|
|
</p></li><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li11932341124013"><span>Upload the backup data files to the OBS bucket by using OBS Browser+.</span><p><p id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_p5866126154517">If the backup file to be uploaded does not exceed 5 GB, upload the file using the OBS console by referring to step <a href="#dcs-migration-190703002__dcs-ug-0312037_li8307135965315">3</a>.</p>
|
|
<p id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_p78781449183">If the backup file to be uploaded is larger than 5 GB, perform the following steps to upload the file using OBS Browser+.</p>
|
|
<ol type="a" id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_ol159571723610"><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li1695767113614">Download OBS Browser+.<p id="dcs-migration-190703002__dcs-ug-0312037_p16850164915377"><a name="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li1695767113614"></a><a name="dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li1695767113614"></a>For details, see section "Downloading OBS Browser+" in <em id="dcs-migration-190703002__dcs-ug-0312037_i17217435104313">Object Storage Service (OBS) Tools Guide (OBS Browser+)</em>.</p>
|
|
</li><li id="dcs-migration-190703002__dcs-ug-0312037_li11225208162112">Install OBS Browser+.<p id="dcs-migration-190703002__dcs-ug-0312037_p1022518842111"><a name="dcs-migration-190703002__dcs-ug-0312037_li11225208162112"></a><a name="dcs-ug-0312037_li11225208162112"></a>For details, see section "Installing OBS Browser+" in <em id="dcs-migration-190703002__dcs-ug-0312037_i118557531214">Object Storage Service (OBS) Tools Guide (OBS Browser+)</em>.</p>
|
|
</li><li id="dcs-migration-190703002__dcs-ug-0312037_li201961913103814">Log in to OBS Browser+.<p id="dcs-migration-190703002__dcs-ug-0312037_p1119621313811"><a name="dcs-migration-190703002__dcs-ug-0312037_li201961913103814"></a><a name="dcs-ug-0312037_li201961913103814"></a>For details, see section "Logging In to OBS Browser+" in <em id="dcs-migration-190703002__dcs-ug-0312037_i104881711215">Object Storage Service (OBS) Tools Guide (OBS Browser+)</em>.</p>
|
|
</li><li id="dcs-migration-190703002__dcs-ug-0312037_li144125145718">Create a bucket.</li><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li10948943114817">Upload backup data.</li></ol>
|
|
</p></li><li id="dcs-migration-190703002__dcs-ug-0312037_li8307135965315"><a name="dcs-migration-190703002__dcs-ug-0312037_li8307135965315"></a><a name="dcs-ug-0312037_li8307135965315"></a><span>On the OBS console, upload the backup data files to the OBS bucket.</span><p><div class="p" id="dcs-migration-190703002__dcs-ug-0312037_p73071659115311">Perform the following steps if the backup file size does not exceed 5 GB:<ol type="a" id="dcs-migration-190703002__dcs-ug-0312037_ol17307059105315"><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li11425644112117">In the bucket list, click the name of the created bucket.</li><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li6425134472111">In the navigation pane, choose <strong id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_b7335667220">Objects</strong>.</li><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li8425844162114">On the <strong id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_b1434535111128">Objects</strong> tab page, click <strong id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_b8346251131216">Upload Object</strong>.</li><li id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li4601227114516">Upload the objects.<p id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_p2092314104615"><a name="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li4601227114516"></a><a name="dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_li4601227114516"></a>To upload objects, drag files or folders to the <strong id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_b1466016717292">Upload Object</strong> area or click <strong id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_b13375203619291">add file</strong>. A maximum of 100 files can be uploaded at a time. The total size cannot exceed 5 GB.</p>
|
|
<div class="fignone" id="dcs-migration-190703002__dcs-ug-0312037_fig184786179256"><span class="figcap"><b>Figure 1 </b>Uploading an object</span><br><span><img id="dcs-migration-190703002__dcs-ug-0312037_image174788172258" src="en-us_image_0000001634759086.png"></span></div>
|
|
</li><li id="dcs-migration-190703002__dcs-ug-0312037_li29854713516">(Optional) Select <strong id="dcs-migration-190703002__dcs-ug-0312037_en-us_topic_0179456697_dcs-migration-190703002_b418982912617">KMS encryption</strong> to encrypt the file you want to upload.</li><li id="dcs-migration-190703002__dcs-ug-0312037_li103071459205315">Click <strong id="dcs-migration-190703002__dcs-ug-0312037_b2373124572710">Upload</strong>.</li></ol>
|
|
</div>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="dcs-migration-190703002__section9876193816277"><h4 class="sectiontitle">Creating a Migration Task</h4><ol id="dcs-migration-190703002__ol81391154144716"><li id="dcs-migration-190703002__li03689479305"><span>Go to the DCS console.</span></li><li id="dcs-migration-190703002__li16119587498"><span>In the navigation pane, choose <strong id="dcs-migration-190703002__b1073120416274">Data Migration</strong>.</span></li><li id="dcs-migration-190703002__li67372014165120"><span>Click <strong id="dcs-migration-190703002__b826716383275">Create Backup Import Task</strong>.</span></li><li id="dcs-migration-190703002__li14133134613500"><span>Enter the task name and description.</span><p><p id="dcs-migration-190703002__p044117593568">The task name must start with a letter, contain 4 to 64 characters, and contain only letters, digits, hyphens (-), and underscores (_).</p>
|
|
</p></li><li id="dcs-migration-190703002__li7814624195313"><span>In the <strong id="dcs-migration-190703002__b1378581610478">Source Redis</strong> area, select <strong id="dcs-migration-190703002__b19787171684717">OBS bucket</strong> for <strong id="dcs-migration-190703002__b19254112645013">Data Source</strong> and then select the OBS bucket to which you have uploaded backup files.</span></li><li id="dcs-migration-190703002__li1281412951215"><span>Click <strong id="dcs-migration-190703002__b32581745481">Add Backup</strong> and select the backup files to be migrated.</span></li><li id="dcs-migration-190703002__li1264738143811"><span>In the <strong id="dcs-migration-190703002__b7459123818489">Target Redis</strong> area, select the <strong id="dcs-migration-190703002__b81601464910">Target Redis Instance</strong> prepared in <a href="#dcs-migration-190703002__section393611177">Prerequisites</a>.</span></li><li id="dcs-migration-190703002__dcs-migration-190703002_li101346111301"><span>If the target Redis instance has a password, enter the password and click <strong id="dcs-migration-190703002__b26391638134910">Test Connection</strong> to check whether the password is correct. If the instance is not password-protected, click <strong id="dcs-migration-190703002__b177974334911">Test Connection</strong> directly.</span></li><li id="dcs-migration-190703002__li949595110140"><span>Click <strong id="dcs-migration-190703002__b423713107215">Next</strong>.</span></li><li id="dcs-migration-190703002__li139913717619"><span>Confirm the migration task details and click <strong id="dcs-migration-190703002__b17364942162218">Submit</strong>.</span><p><p id="dcs-migration-190703002__p104923381679">Go back to the data migration task list. After the migration is successful, the task status changes to <strong id="dcs-migration-190703002__b38116245234">Successful</strong>.</p>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="dcs-migration-190703002__section1762337185412"><h4 class="sectiontitle">Verifying the Migration</h4><p id="dcs-migration-190703002__p279273895413">Before data migration, if the target Redis has no data, check data integrity after the migration is complete in the following way:</p>
|
|
<ol id="dcs-migration-190703002__ol569010368361"><li id="dcs-migration-190703002__dcs-migration-190703003_en-us_topic_0292880550_dcs-migration-190703003_li94593118471">Connect to the source Redis and the target Redis. Connect to Redis by referring to <a href="dcs-ug-0326009.html">Accessing a DCS Redis Instance Through redis-cli</a>.</li><li id="dcs-migration-190703002__dcs-migration-190703003_li10257713154717">Run the <strong id="dcs-migration-190703002__dcs-migration-190703003_en-us_topic_0292880550_dcs-migration-190703003_b5674145372816">info keyspace</strong> command to check the values of <strong id="dcs-migration-190703002__dcs-migration-190703003_en-us_topic_0292880550_dcs-migration-190703003_b6780111112291">keys</strong> and <strong id="dcs-migration-190703002__dcs-migration-190703003_en-us_topic_0292880550_dcs-migration-190703003_b20825181414299">expires</strong>.<p id="dcs-migration-190703002__dcs-migration-190703003_p203461224529"><span><img id="dcs-migration-190703002__dcs-migration-190703003_image152912031408" src="en-us_image_0293255709.png"></span></p>
|
|
</li><li id="dcs-migration-190703002__dcs-migration-190703003_li1878042516480">Calculate the differences between the values of <strong id="dcs-migration-190703002__dcs-migration-190703003_b7585046192918">keys</strong> and <strong id="dcs-migration-190703002__dcs-migration-190703003_b2585204614294">expires</strong> of the source Redis and the target Redis. If the differences are the same, the data is complete and the migration is successful.</li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dcs-migration-0312002.html">Migrating Data from Self-Hosted Redis to DCS</a></div>
|
|
</div>
|
|
</div>
|
|
|