Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy data from an instance to another - first step #1804

Open
wants to merge 15 commits into
base: 6.0
Choose a base branch
from
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 82 additions & 1 deletion cloud_edition/flexibility_mode/docs/environments_access.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ If **akeneo**, as an SSH user or as a PIM process, creates files in the SFTP sub
.. _`Akeneo Help Center`: https://help.akeneo.com/portal/articles/access-akeneo-flexibility.html?utm_source=akeneo-docs&utm_campaign=flexibility_partner_starterkit


Copy data from one instance to another
Transfer data from one instance to another
**************************************
Doodoune marked this conversation as resolved.
Show resolved Hide resolved

**Scenario:**
Expand Down Expand Up @@ -138,3 +138,84 @@ Copy data from one instance to another
On the SCP command, please note that no domain is specified.

Use the short host name of instance. Connect to the target server and run `hostname` to get this value.


Copy process (MySQL data & pictures (including assets)) from one instance to another
************************************************************************************

**Scenario:**

User wants to copy all the data (including assets & pictures) from staging instance to production instance :

**Step one:**
Doodoune marked this conversation as resolved.
Show resolved Hide resolved

First, create a MySQL dump of your data:

.. code-block:: bash

#on mystaging.cloud.akeneo.com
mysqldump -u akeneo_pim -p$APP_DATABASE_PASSWORD akeneo_pim > /home/akeneo/pim/dump_dd_mm_yy.sql
Doodoune marked this conversation as resolved.
Show resolved Hide resolved

You could compress it to be more efficient during the copying process.
Then, transfer your dump into the destination instance (cf previous paragraph)
Finally, in your destination instance, import your MySQL dump:

.. code-block:: bash

#on myproduction.akeneo.com
mysql -u akeneo_pim -p$APP_DATABASE_PASSWORD akeneo_pim < /home/akeneo/pim/dump_dd_mm_yy.sql
Doodoune marked this conversation as resolved.
Show resolved Hide resolved

**Step two:**
Doodoune marked this conversation as resolved.
Show resolved Hide resolved

Find the asset Location using the following command:

.. code-block:: bash

bin/console debug:config OneupFlysystemBundle

In the result you will see something like this
Doodoune marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: bash

asset_storage_adapter:
local:
location: /home/akeneo/pim/var/file_storage/asset

**Step three:**
Doodoune marked this conversation as resolved.
Show resolved Hide resolved

Once the assets locations are identified you can compress all files in a zip and copy it to your destination instance.
Doodoune marked this conversation as resolved.
Show resolved Hide resolved

**Step four:**
Doodoune marked this conversation as resolved.
Show resolved Hide resolved

re-index Elastic Search

- First reset the indexes.
Doodoune marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: bash

bin/console akeneo:elasticsearch:reset-indexes

- Reindex using following commands
Doodoune marked this conversation as resolved.
Show resolved Hide resolved

.. code-block:: bash

# Index products
bin/console pim:product:index --all

# Index product model
bin/console pim:product-model:index --all

# Index product proposals
bin/console pimee:product-proposal:index

# Index published products
bin/console pimee:published-product:index

# Index reference entities
bin/console akeneo:reference-entity:index-records --all

# Index assets (4.x)
bin/console akeneo:asset-manager:index-assets --all

After the reset you might have the feeling that all the products are disappeared from the product list because it is based on elastic search. Once, it will be fully indexed all the products will be returned back.