Jump to content

HannaMigrate - to bulk export/import Hanna Codes


MarkE
 Share

Recommended Posts

See my query here: 

My solution was to bulid my own module - HannaMigrate. Basically it exports or imports all Hanna codes in a database.

It was built to use along with my migration module ProcessDbMigrate, but should operate without it (but not tested).

It provides 2 methods exportAll() and importAll()

Simple usage:

  • Install the module.
  • Use TracyDebugger console in the source database to:
    $hannaMig = $modules->get('HannaMigrate'); $hannaMig->exportAll('optional_migration_name');
  • where optional_migration_name is a name of a related migration, if you are using ProcessDbMigrate. Otherwise leave blank and the code will be in assets/migrations/hanna-codes/.
  • Then use TracyDebugger console in the target database to:
    $hannaMig = $modules->get('HannaMigrate'); $hannaMig->importAll('optional_migration_name');
    (Do this while on the Hanna Codes page, then refresh the page to see the results and any error messages).

You could also use the methods in your own code. I may look to integrating it more fully in ProcessDbMigrate.

 

  • Like 6
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...