Skip to content

Upgrade from Mundipagg to Pagar.me with data migration

Mauricio Haygert edited this page Jun 21, 2022 · 3 revisions

Preparing for migration

Minimum versions required

  • Magento: 2.1
  • Mundipagg module: 2.1.0-beta

Maintenance mode

As any module installation, the upgrade will generate some down time and is recommended to set Magento 2 in maintenance mode.

See Magento 2 documentation for more details.

Minimum data migration recommended

To ensure the correct return of payments, we recommend the minimum migration of data from the "config" and "card" table groups.

Test in a non-production environment

It is recommended to test the migration in a non-production environment (with versions and configurations equal to production) and with data similar to production.

Benchmark times

The migration time varies depending on the amount of data and the database server.

The table below shows a reference:

Rows Time
20.000 ~1 second
200.000 ~2 seconds
1.000.000 ~10 seconds

Migrating

Updating module

Install Pagar.me module:

composer require pagarme/pagarme-magento2-module

Remove Mundipagg module:

composer remove mundipagg/mundipagg-magento2-module

Update dependencies:

composer update

Update Magento 2:

./bin/magento setup:upgrade
./bin/magento setup:di:compile

Migrating data

List data from Mundipagg module:

bin/magento pagarme:migrate:list

List

Execute data migration to Pagar.me module:

bin/magento pagarme:migrate:execute 

Execute

Options

Migrating groups of tables:

bin/magento pagarme:migrate:execute group=config

Execute Group

Parameter "group" accepts four inputs:

  • config: only configuration info
  • card: cards and customers info
  • order: orders, charges and transactions info
  • recurrence: recurrence products, subscriptions and charges

Migrating with limit of rows:

bin/magento pagarme:migrate:execute limit=10K

Execute Limit

Parameter "limit" accepts values as followed examples:

  • 500: limits to 500 rows
  • 10k: limits to 10,000 rows
  • 2M: limits to 2,000,000 rows

Refreshing Magento 2

Refresh indexes and cache:

./bin/magento indexer:reindex
./bin/magento cache:flush

Troubleshooting

All output from MigrateData.php operations are saved to file:

var/log/Pagarme_Migration.log 
Clone this wiki locally