Skip to content

Commit 2ffeac4

Browse files
authored
Merge pull request #11795 from mjlassila/mjlassila/s3-migration-documentation-improvement
Refer to configured datastore id when migrating from local datastore to S3
2 parents 68a8999 + ec30cdf commit 2ffeac4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

doc/sphinx-guides/source/developers/deployment.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,16 @@ Migrating Datafiles from Local Storage to S3
110110

111111
A number of pilot Dataverse installations start on local storage, then administrators are tasked with migrating datafiles into S3 or similar object stores. The files may be copied with a command-line utility such as `s3cmd <https://s3tools.org/s3cmd>`_. You will want to retain the local file hierarchy, keeping the authority (for example: 10.5072) at the bucket "root."
112112

113-
The below example queries may assist with updating dataset and datafile locations in the Dataverse installation's PostgresQL database. Depending on the initial version of the Dataverse Software and subsequent upgrade path, Datafile storage identifiers may or may not include a ``file://`` prefix, so you'll want to catch both cases.
113+
The below example queries may assist with updating dataset and datafile locations in the Dataverse installation's PostgresQL database. Depending on the initial version of the Dataverse Software and subsequent upgrade path, Datafile storage identifiers may or may not include a ``file://`` prefix, so you'll want to catch both cases.
114+
115+
In the following queries, ``<id>://`` refers to the ``id`` you have set for the datastore in the configuration (see the :ref:`file-storage` section of the Installation Guide).
114116

115117
To Update Dataset Location to S3, Assuming a ``file://`` Prefix
116118
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
117119

118120
::
119121

120-
UPDATE dvobject SET storageidentifier=REPLACE(storageidentifier,'file://','s3://')
122+
UPDATE dvobject SET storageidentifier=REPLACE(storageidentifier,'file://','<id>://')
121123
WHERE dtype='Dataset';
122124

123125
To Update Datafile Location to your-s3-bucket, Assuming a ``file://`` Prefix
@@ -126,17 +128,17 @@ To Update Datafile Location to your-s3-bucket, Assuming a ``file://`` Prefix
126128
::
127129

128130
UPDATE dvobject
129-
SET storageidentifier=REPLACE(storageidentifier,'file://','s3://your-s3-bucket:')
131+
SET storageidentifier=REPLACE(storageidentifier,'file://','<id>://your-s3-bucket:')
130132
WHERE id IN (SELECT o.id FROM dvobject o, dataset s WHERE o.dtype = 'DataFile'
131133
AND s.id = o.owner_id AND s.harvestingclient_id IS null
132-
AND o.storageidentifier NOT LIKE 's3://%');
134+
AND o.storageidentifier NOT LIKE '<id>://%');
133135

134136
To Update Datafile Location to your-s3-bucket, Assuming no ``file://`` Prefix
135137
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136138

137139
::
138140

139-
UPDATE dvobject SET storageidentifier=CONCAT('s3://your-s3-bucket:', storageidentifier)
141+
UPDATE dvobject SET storageidentifier=CONCAT('<id>://your-s3-bucket:', storageidentifier)
140142
WHERE id IN (SELECT o.id FROM dvobject o, dataset s WHERE o.dtype = 'DataFile'
141143
AND s.id = o.owner_id AND s.harvestingclient_id IS null
142144
AND o.storageidentifier NOT LIKE '%://%');

0 commit comments

Comments
 (0)