Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 821d0e1

Browse files
committed
Improved rsync remote to remote, added better example to cli
1 parent bab0c2b commit 821d0e1

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

src/cloud/live/stage-prod-migrate.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,36 @@ You can use the [Magento Cloud CLI commands]({{ site.baseurl }}/cloud/reference/
128128

129129
## Migrate static files
130130

131-
[Static files](https://glossary.magento.com/static-files) are stored in `mounts`. You can list the mounts available in your project using the `magento-cloud` CLI:
131+
[Static files](https://glossary.magento.com/static-files) are stored in `mounts`. There are two methods for migrating files from a source mount location, such as your local environment, to a destination mount location. Both methods use the `rsync` utility, but we recommend using the `magento-cloud` CLI for moving files between the local and remote environment.
132+
133+
### Migrate files using the CLI
134+
135+
You can use the `mount:upload` and `mount:download` CLI commands to migrate files. Both commands use the `rsync` utility, but the CLI provides options and prompts tailored to the {{site.data.var.ece}} environment. For example, if you use the simple command, the CLI prompts you to select which mount or mounts to upload or download.
132136

133137
```bash
134-
magento-cloud mount:list
138+
magento-cloud mount:download
135139
```
136140

137-
There are two methods for migrating files from a source mount location, such as your local environment, to a destination mount location. Both methods use the `rsync` utility, but we recommend using the `magento-cloud` CLI.
141+
Sample response:
138142

139-
### Migrate files using the CLI
143+
```terminal
144+
Enter a number to choose a mount to download from:
145+
[0] app/etc
146+
[1] pub/static
147+
[2] var
148+
[3] pub/media
149+
[4] All mounts
150+
> 3
140151
141-
You can use the `mount:upload` and `mount:download` CLI commands to migrate files. Both commands use the `rsync` utility, but the CLI provides options and prompts tailored to the {{site.data.var.ece}} environment.
152+
Target directory: ~/pub/media/
142153
143-
The following example uploads files from a local `pub/media/` folder to the remote `pub/media/` folder for the current environment:
154+
Downloading files from the remote mount pub/media to pub/media
155+
156+
Are you sure you want to continue? [Y/n] Y
157+
```
158+
159+
{:.procedure}
160+
To upload files from a local `pub/media/` folder to the remote `pub/media/` folder for the current environment:
144161

145162
```bash
146163
magento-cloud mount:upload --source /path/to/project/pub/media/ --mount pub/media/
@@ -174,7 +191,7 @@ rsync -azvP <source> <destination>
174191
This command uses the following options:
175192

176193
- `a`–archive
177-
- `z`–compress
194+
- `z`–compress files during the migration
178195
- `v`–verbose
179196
- `P`–partial progress
180197

@@ -186,20 +203,24 @@ To migrate static files from remote-to-remote environments directly (fast approa
186203
{:.bs-callout-info}
187204
To transfer media from remote-to-remote environments directly, you must enable SSH agent forwarding, see [GitHub guidance](https://developer.github.com/v3/guides/using-ssh-agent-forwarding/).
188205

189-
1. [Open an SSH connection]({{ site.baseurl }}/cloud/env/environments-ssh.html#ssh) to the source environment.
206+
1. Use SSH to log in to the source environment. Do not use the `magento-cloud` CLI.
190207

191-
To find the **SSH access** link in your Project Web Interface, select the environment and click **Access Site**. The syntax for the SSH command is as follows:
208+
To find the **SSH access** link in your Project Web Interface, select the environment and click **Access Site**.
192209

193210
```bash
194211
195212
```
196213

197-
1. Use the `rsync` command to copy the `pub/media` directory from your current environment to a different remote environment:
214+
Using the `-A` option is very important because it enables forwarding of the authentication agent connection.
215+
216+
1. Use the `rsync` command to copy the `pub/media` directory from your source environment to a different remote environment.
198217

199218
```bash
200219
rsync -azvP pub/media/ <[email protected]>:pub/media/
201220
```
202221

222+
1. Log in to the other remote environment to verify the files migrated successfully.
223+
203224
## Migrate the database {#cloud-live-migrate-db}
204225

205226
{%include cloud/note-db-import-export-warning.md%}

0 commit comments

Comments
 (0)