Copying company data from one server to another, Ax 2009 - axapta

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

Related

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

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/

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.

Should I go with attaching MDF file to SQL Express or a real deployment script to SQL Server?

I am building a blog-like publishing system on ASP.NET 4.0 (with EF 4.0) that I want to be very easily deployable/backupable in the first place. I am at a decision point of whether making the system to create a database in an SQL Server and use that (traditionally), or have a App_Data MDF file in the site and just attach to that one with SQL Express. I know the memory/size limitations of Express editions, and I won't be hitting the limits as this is not a performance-critical business application or any serious stuff. Just a simple CMS with blogs/writings/photos (actual photos are NOT saved in database, just their paths are saved in MDF) and that's it. I see no problem using MDF, but I'm not an expert on the topic too as I've never worked/created a website using MDF file. I always deployed on the SQL Server, but I don't want to deal with users/roles/permissions and the last thing that I want to have a user having installation problems due to database settings.
What should I go with? Any problems that I would face with MDF? Recommendations?
IF you use SQL Server Express - which is a server - I would always opt for a "real" database approach: attach your database to the server, access it by its database name, deploy SQL scripts to update it.
That "attach DB from file path" always seemed like a half-baked and rather messy kludge to me.....
If you don't need that kind of power - investigate SQL Server Compact Edition which is a one-file only, in-process database. It has its limitations - no stored procedures, doesn't support certain data types like VARCHAR(MAX) or XML - but for easier scenarios, it's perfect and easy to use - just deploy it along your app. It's single-user, e.g. you don't share the data between several clients, it's a local store for each user/app on its own

ASP/ASP.net: Web-based JET database management tool?

I need to manipulate some tables in a JET database housed on a web-server:
check existing indexes
change table cluster/primary key
see what tables exist
rename tables
add tables
drop tables
browse data
etc
I don't have the option of installing PlaneDisaster or Access (even if i had it) on the local machine.
I've already written a generic web-based query tool. I'd rather not have to get into writing a whole web-based database maintenance GUI. Someone must have done this already, and probably many times over.
A partial answer might be Compare'Em
http://home.gci.net/~mike-noel/CompareEM-LITE/CompareEMscreens/CompareEM-About.htm The Pro version allows you to create SQL statements to update the Access database file. This will allow you to generate the differences between one version and a newer version.
His website isn't very clear but as I recall the price for the Pro version was $10.
As you say you have already done a generic web based query tool. The problem with JET is that you cannot connect with it as database server like you can do with one SQL server in order to process changes to tables and other maintenance procedures. Jet is is not a client/server RDBMS. You need to have an application in the server to do that for you as you already have done with your generic web based tool, or download the database to your machine. That's why you have done some procedures and locate them in the server as asp pages.
Anyway you can use JetSQLConsole, if you don't want to use Planedisaster or Access, but remember that you need always an application on the server to to the job for you
You can also use access "in your machine" and connect to a database located in a URL (http://myserver/mydatabase.mdb) but remember when you are doing this you are downloading all the database and when you save it you are uploading it again.

Resources