content/operate/rc/databases/import-data.md
You can import an existing dataset into your Redis Cloud instance from an existing Redis server or an RDB file.
{{< warning >}} Data imported into an existing database overwrites existing data.
{{< note >}} Expired keys are not imported. As a result, the number of keys in the source and destination databases can be different after the import is complete. {{< /note >}}
Make sure the Redis version of the source database is compatible with the database where the data will be imported.
To import a dataset from any publicly available Redis Open Source server:
6379.If you have an RDB or a compressed RDB file from a previous backup, you can restore data from that file into your Redis Cloud database.
Select the tab for your storage location type.
{{< multitabs id="rdb-import-locations" tab1="FTP or HTTP server" tab2="AWS S3" tab3="Google Cloud Storage" tab4="Azure Blob Storage" >}}
Select Databases from the Redis Cloud console menu and then select your database from the list.
Select Import.
Enter the details for the RDB file:
<protocol>://[username][:password]@hostname[:port]/[path/]filename.rdb[.gz]
Where:
protocol - Server protocol: ftp, ftps, http, httpsusername - Your username, if necessarypassword - Your password, if necessaryhostname - Hostname or IP address of the serverport - Port number of the server, if not 6379path - Path to the file, if necessaryfilename - Filename of the RDB file, including the .gz suffix if the file is compressed{{< note >}}
If your FTP username or password contains special characters such as @, \, or :, you must URL encode (also known as Percent encode) these special characters. If you don't, your database may become stuck.
{{< /note >}}
For sharded databases with multiple RDB files, select Add source to add another RDB file. {{< warning >}} For sharded databases with multiple RDB files, make sure to add every file before proceeding. {{< /warning >}}
Select Import.
-tab-sep-
To use the Redis Cloud console to import your data, you must first share the file from the Amazon Web Services (AWS) management console.
To share and import an RDB file that is stored in an AWS Simple Storage Service (S3) bucket:
In the AWS Management Console, configure the bucket's bucket policy to give access to Redis Cloud:
Use the Services menu to locate and select Storage > S3. This takes you to the Amazon S3 admin panel.
Use the Buckets list to locate and select your bucket. When the settings appear, select the Permissions tab, locate the Bucket policy section, and then click Edit.
If there is no existing bucket policy, add the following JSON bucket policy. Replace UNIQUE-BUCKET-NAME with the name of your bucket.
{
"Version": "2012-10-17",
"Id": "MyBucketPolicy",
"Statement": [
{
"Sid": "RedisCloudBackupsAccess",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::168085023892:root"
},
"Action": [
"s3:PutObject",
"s3:getObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::UNIQUE-BUCKET-NAME/*"
}
]
}
If a bucket policy already exists, add the following JSON policy statement to the list of statements. Replace UNIQUE-BUCKET-NAME with the name of your bucket.
{
"Sid": "RedisCloudBackupsAccess",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::168085023892:root"
},
"Action": [
"s3:PutObject",
"s3:getObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::UNIQUE-BUCKET-NAME/*"
}
Save your changes.
If the bucket is encrypted using SSE-KMS, add the following statement to your key policy. If you do not have a key policy, see Creating a key policy. Replace UNIQUE-BUCKET-NAME with the name of your bucket and CUSTOM-KEY-ARN with your key's Amazon Resource Name (ARN).
{
"Sid": "Allow use of the key",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::168085023892:root"
},
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*",
"kms:DescribeKey"
],
"Resource": [
"arn:aws:s3:::UNIQUE-BUCKET-NAME/*",
"CUSTOM-KEY-ARN"
]
}
In the Redis Cloud console, select the target database from the database list.
Select Import.
Enter the details for the RDB file:
s3://bucketname/[path/]filename.rdb[.gz]
Where:
bucketname - Name of the S3 bucketpath - Path to the file, if necessaryfilename - Filename of the RDB file, including the .gz suffix if the file is compressedFor sharded databases with multiple RDB files, select Add source to add another RDB file.
Select Import.
-tab-sep-
To use the Redis Cloud console to import your data, you must first share the file from the Google Cloud console.
To share and import an RDB file that is stored in a Google Cloud Storage bucket:
In the Google Cloud Storage bucket, edit the file's Access Control List to give read access to Redis Cloud:
[email protected]For more info, see Set ACLs.
In the Redis Cloud console, select the target database from the database list.
Select Import.
Enter the details for the RDB file:
Source type - Select Google Cloud Storage.
Source path - Enter the URL for the RDB file: gs://bucketname/[path/]filename.rdb[.gz]
Where:
bucketname - Name of the GCS bucketpath - Path to the filefilename - Filename of the RDB file, including the .gz suffix if the file is compressedFor sharded databases with multiple RDB files, select Add source to add another RDB file.
Select Import.
-tab-sep-
To import an RDB file stored in a Microsoft Azure Blog storage container:
In the Redis Cloud console, select the target database from the database list.
Select Import.
Enter the details for the RDB file:
Source type - Select Azure Blob Storage.
Source path - Enter the URL for the RDB file:
abs://:storage_account_access_key@storage_account_name/[container/]filename.rdb[.gz]
Where:
storage_account_access_key - Primary access key to the storage accountstorage_account_name - Name of the storage accounturl - URL of the storage accountcontainer - Name of the container, if necessaryfilename - Filename of the RDB file, including the .gz suffix if the file is compressedFor sharded databases with multiple RDB files, select Add source to add another RDB file.
Select Import.
{{< /multitabs >}}