Generate a Script to Merge Organisations

Sometimes an organisation is acquired by or merged into another organisation. Use this activity to generate a SQL script to merge data from one organisation into another organisation.

Most references to the source organisation's ID in the MineMarket database will be replaced with the target organisation's ID. Some examples of this impact include:

  • Any lines of credit are moved to the target organisation.
  • The target organisation becomes the buyer/seller/provider (as applicable) of any contracts, despatch orders, costs and service charges.
  • Organisation fields are updated in invoices, payments, refunds and journal entries (even if locked); however, any stored invoice XML data and stored invoice PDF documents are not altered.
  • Organisation fields are updated in stockpiles, despatches, samples and toll accounts.
  • Organisation parameters are updated in reports such as cash flow and invoice revaluations.
  • Organisations are updated in the MineMarket Data Mart database when the next reconciliation is run by the MineMarket Data Mart Service.

Copying the source organisation's addresses to the target organisation as additional addresses is optional.

The following data for the source organisation is not merged:

  • Ownership
  • Bank accounts
  • Tax registration numbers
  • Default payment terms
  • Default accounting groups

Important: The script can only be run when the MineMarket Service is not running. Because the script is not reversible, ensure a backup of the MineMarket database exists.

After running the script:

  • The Audit Explorer can be used to view the Merge action.
  • The source organisation can be deleted.

Security Note: You need the Allow the user to merged organisations security right in the Organisations domain security rights group for this activity. Running the script can only be conducted with adequate network, domain and administrator permissions to the MineMarket Database Server.

Activity Steps

  1. Open the Merge Organisations screen.
  2. Select the Organisation To Be Merged Into Another Organisation from the organisations defined on the Organisations panel of the Solution Explorer. This is the 'source' organisation.
  3. Select the Target Organisation.
  4. Select whether to Merge Addresses.
  5. Click Generate Script.
  6. To copy the script to the clipboard, click Copy Script.
  7. Click Close.
  8. To run the script:
    1. Close all client connections to the MineMarket Server (including the MineMarket Marketing Service).
    2. Stop the MineMarket Service.
    3. Back up the MineMarket database.

      Important: The script is not reversible.

    4. For SQL Server: Run the script in a SQL Server database scripting environment against the database.
    5. For Oracle: Run the script in an Oracle database scripting environment against the schema.