What is the best way to migrate or export/import data from Microsoft AX4 to AX7 - axapta

On the one side I have a working AX4 environment and now want to upgrade to the new AX7.
Therefore we need some tables of the database to be imported or migrated to the new one.
What is the best way to achieve that?

There is no direct upgrade path from AX4 to AX7 (AFAIK), nor is there a way to directly move objects.
How many objects need migrated? You're essentially left with two options.
XPO objects into AX 2012 staging environment, then upload the AX 2012 modelstore to LCS and that will migrate the code and create the migration project in AX7 (See https://ax.help.dynamics.com/en/wiki/upg101-preparing-for-migration/)
Recreate the objects by hand :(
A little more detail on (1.) is in AX 2012, instead of the code being stored on disk in a bunch of layer files, it's stored in a separate SQL database. And a modelstore is conceptually a *.bak file of that database. So when you import an XPO into AX 4.0 CUS layer, it ends up in axCUS.aod; likewise when you import an XPO in AX 2012, it ends up in the modelstore in the CUS layer.
To uplift code in AX7 from AX12, you basically take that *.modelstore file and .zip (compress) it and upload it on lcs.dynamics.com. You also must connect LCS to VSO (visual studio online), because it creates tasks and things to do.
You then wait a while (usually about an hour, but I've had it take 1-2 days when they were changing the framework), then you have the objects in VSO and you can sync them to your AX7 environment.
EDIT: Regarding data from AX 4.0...I'm definitely not yet an expert on getting data into AX7 but they generally push data entities, which are essentially an abstraction of parts of the database. If it's one-time data moves, you can possibly use the Excel data connector.
See these resource:
http://msdax7.blogspot.com/2016/02/open-to-excel-in-microsoft-dynamics-ax.html
http://msdax7.blogspot.com/2016/02/exportimport-data-using-data-management.html
https://ax.help.dynamics.com/en/wiki/data-entities/

Related

Executing script (command against external database) after AX Entity export

I'm working on a project to create an external data warehouse using some data from Microsoft Dynamics AX 7. I am using the new BYOD approach which allows you to define an external database, and then use that database as the target when exporting one or more Dynamics entities.
See: https://blogs.msdn.microsoft.com/dynamicsaxbi/2016/07/27/export-dynamics-ax7-entities-to-your-own-azure-sql-database/
At the time of writing, this export mechanism is able to do incremental exports (only inserted or updated records) but it lacks support for record deletions.
With AX7 you cannot directly access the AX database from external systems, so what I'm wanting to do is run a post-export SQL script that will examine the MSSQL Change Tracking tables and based on that data for deleted rows, execute a series of delete systems on the same external database.
If it is possible, I'm hoping to use this more generic, sql-centric approach rather than getting involved in writing custom AX entities and export code.
How might one best approach this?

Copying Business Setup Data to a new instance

Re: AX 2012 R2 Service Pack 2
I am looking for options in copying Business Setup data (eg Companies, Chart of Accounts, Location, etc) from one AX instance to another instance. The instances are currently in development so we don't have to worry about wiping out data. As of now one single instance has a master copy of all Business Setup information. What I want to do is copy that data to multiple development instances.
I can refresh the Model Store and Business Data with no problem. But the Business Setup data is a different beast entirely. In AX 2009, there was a feature to copy this information, but it has since been removed in AX 2012. I've read multiple articles on this but each one warns that it's either not recommended or only for testing. I need something that is safe to use.
Has anyone found a clean process to copy business setups from one instance to another in AX 2012?
The really simple solution is to have an AX setup database/environment without any transactions.
To deploy do a SQL Server, do a backup of the setup database and restore to the target database followed by a full AX dictionary synchronize in the target application.
This will of cause wipe out any transactions, setup etc. done in the target database.
After import a script is run to change file locations not to point to setup locations etc.
You may need to save some data beforehand using the Administration, Periodic, Data Export/Import, Export then import after the wipe.
Below is the actual procedure used by one of my customers. The setup is done in the production environment and the target may be the flow testing environment.
Sketch list:
Backup setup
Export target data
Stop target AOS
Restore to target
Run SQL script
Start target AOS
Database synchronization
Run AX script
Import target data
This procedure is also great for making a test environment of a production environment.
There is a Microsoft document, "Microsoft Dynamics AX 2012: Tech Domain New Features Module 5: Moving Between Environments" on this subject (Google that entire title and it will be the first hit).
The procedure that Jan outlines in his answer is correct but more high level. There is data in several tables that store configuration information that you want to wipe out after the restore, and insert the rows that were there prior to the restore. I.e., there are some tables that you need to export before you do the restore, so that you can create SQL scripts to insert that data.
You can do it without these procedures, but then you have a messy environment with AOS servers listed that aren't in the environment, and if you have a reporting server, help server, etc., you have to go through and change all of that manually. If you save the data prior to the restore, then you have scripts that will get the configuration where it needs to be and it just takes one second.
You can copy commonly used values from an existing company to a new one, as long as both companies are in the same database. For example, if you have a standard list of symptom codes that is common to all your service management implementations, you can copy the codes easily from one company to another.
To copy data to a new company using RapidStart Services:
Open the new company.
Choose the Lightbulb that opens the Tell Me feature icon, enter Configuration Worksheet, and then choose the related link.
Choose the Copy Data from Company.
On the Copy Company Data page, choose a company to copy from in the Copy From field, and then choose the OK button.
Select a table from one of the configuration packages that you have imported, and then choose the Copy Data action.
This works for me with Microsoft

structure of database of Ms project server 2010

I am working on a project of interaction between Ms project server 2010 And Google aps
what i had to do is :
every time you add a task on Ms project server and you assign to someone ( by adding his resource to the task) ... the task should appear his Google agenda
what i need to do is read some specific attribute from database of Ms project server 2010 ( such as name of task,when it starts , name of project ..) ,
but when i open the database using sql server i found that it contains lot of tables ,
i want to know if there s any documents that explain the whole structure (MCD) and data dictionary .
and thank you
You can use Draft, Published and Reporting databases. But only Reporting is documented and recommended by Microsoft for direct access. You can find its schema in Project 2010 SDK: http://www.microsoft.com/en-us/download/details.aspx?id=15511
Other option is using Project Server event handlers and PSI.
I don't have a document for you... but I do have some code you may find helpful:
MPXJ provides a database reader which will read project data from MS Project MPD databases, and Project Server SQL Server databases (they share a very similar structure). You can either use MPXJ itself abstract the mechanics of reading the data from the database, or you can dive in to the source to see how the tables and columns work, then produce your own queries.
If you want to take the latter approach, you'll find the select statements from the various tables live in the MPD9DatabaseReader class. The result sets are processed in the MPDAbstractReader class.

Copying company data from one server to another, Ax 2009

We will soon be migrating company data from our pre-production server to production with Microsoft Ax 2009. I believe that there are two ways to do this and would like to know of any issues that might arise with the second. This is migrating data across servers and not a simple case of duplicating company data on the same Ax 2009 service.
Use the Import / Export functionality. Administration -> Periodic -> Data Export/Import, create a new definition group and then export it. Recreate the same definition group on the second server then import. Here's an example how to do it for Ax 2012.
Export/Backup the SQL Server database from the first server and restore it over the second. We then would merely be eliminating our test and template company data from the second server. The Ax servers need to have the same patches and development layers installed first. I note that we would need to edit the ServerID value within SysServerConfig table afterwards.
Thanks
The Backup/Restore way to do it is at least 10 times faster.
There are some issues to be aware of though:
Ensure that references to the file systems are correct (e.g. Document parameters)
Server configuration setup
UAC cache file issue described here
Update 1:
For AX 2012 you will also need to have the same model store on the production server as well, this can be accompliced by using database backup/restore or using export/import of the object store as described here.
Update 2:
Update 1 is partly rubbish, both data and model store are copied in the SQL backup/restore. No need to synchronize the database afterwards! But it may come as a surprise.
What about this solution? How To Copy AOS instance from Server to another

Updating SQL Server database with SQL scripts

I have a number of manually written scripts (.sql) for tables, views and stored procedures that are used from an ASP.NET application. These scripts drop the object and recreates them. I need a way to update the database when the scripts change without deleting the object. For example, when a column is added to an existing table that has rows in it, I would need to update this table with this extra column without losing the rows.
I need a way to "update" the database on a single click (I can hook up the changes using a batch file). Does Visual Studio support this kind of functionality?
If you get Visual Studio Team System - Database Edition 2008 - which is now bundled with "Developer Edition" for free - it handles that. Visual Studio database projects without that edition really just store the static SQL that you want to track. The Database Edition is capable of determining the 'deltas' between your SQL and what's in a target database, generating that script, and executing against your database. You do get the option of reviewing that generated SQL, but by default it is very safe [it won't run if it thinks that there will be any data lost].
Yes - it's called Database Projects.
You can define a Visual Studio Database Projects, have create and change SQL scripts inside it, and then execute those against a database connection of your choice when you need to.
See this blog post here for a great explanation, or read the whole series that the 4 guys from Rolla wrote.

Resources