If you want to export current database from UAT and import to Dev box, you need to goto UAT in LCS and export its database it stores in to LCS Asset Library so Then login LCS inside the Dev box use command scripts to run to turn Backpac file to bac then restore.
1. Go to LCS → UAT environment
-
Login to LCS.
-
Open your UAT Tier-2 environment.
-
Go to Environment details.
-
Scroll to Database section.
-
Click "Point-in-time Restore / Export" or "Export database" (depends on LCS version).
2. Export the UAT DB as a BACPAC
-
Choose Export database.
-
Select Standard backup.
-
Provide a name (e.g.,
UAT_2026_01_13). -
Start export.
Export creates a BACPAC in Asset Library.
3. Download the BACPAC
-
Once export completes, go to LCS Asset Library → Database backups.
-
Click the backup.
-
Download the BACPAC file.
Import in to Dev box is 2 ways using SSMS or CMD check below.
Scenario 1.
Import BACPAC into SQL Server (Dev Box) using SSMS
Using SQL Server Management Studio (SSMS)
-
Open SSMS.
-
Connect to
localhost(your Dev VM SQL instance). -
Right-click Databases → Import Data-tier Application…
-
Browse to downloaded
.bacpac. -
Enter database name:
DatabaseLocation & Log location as below
Scenario 2.
Step 1.
Example prompt:
C:\sqlpackage-win-x64-en-170.2.70.1>SqlPackage.exe /a:import /sf:C:\Users\Admin012c0ab00f\Downloads\UAT01backup.bacpac /tsn:localhost /tdn:AxDB2026 /p:CommandTimeout=1200 /TargetTrustServerCertificate:True
During import, the user name and password aren't required. By default, SQL Server uses Microsoft Windows authentication for the user who is currently signed in.
Here's an explanation of the parameters:
- tsn (target server name) – The name of the Microsoft SQL Server instance to import into.
- tdn (target database name) – The name of the database to import into. The database should not already exist.
- sf (source file) – The path and name of the file to import from.
Warning (Optional): If you get any File damaged error while execution
Step 3.
Update the database
Run the following SQL script against the imported database (Ex: AxDB2026). This script adds back the users that you deleted from the source database and correctly links them to the SQL logins for this SQL Server instance. The script also turns change tracking back on. Remember to edit the final ALTER DATABASE statement so that it uses the name of your database.
CREATE USER axdbadmin FROM LOGIN axdbadmin
CREATE USER axmrruntimeuser FROM LOGIN axmrruntimeuser
EXEC sp_addrolemember 'db_datawriter', 'axmrruntimeuser'
CREATE USER axretaildatasyncuser FROM LOGIN axretaildatasyncuser
UPDATE T1
, T1.modifiedby = 'Admin'
, T1.modifieddatetime = getdate()
FROM docuvalue T1
DROP PROCEDURE IF EXISTS SP_ConfigureTablesForChangeTracking
-- Begin Refresh Retail FullText Catalogs
DECLARE @RFTXNAME NVARCHAR(MAX);
DECLARE @RFTXSQL NVARCHAR(MAX);
DECLARE retail_ftx CURSOR FOR
SELECT OBJECT_SCHEMA_NAME(object_id) + '.' + OBJECT_NAME(object_id) fullname FROM SYS.FULLTEXT_INDEXES
WHERE FULLTEXT_CATALOG_ID = (SELECT TOP 1 FULLTEXT_CATALOG_ID FROM SYS.FULLTEXT_CATALOGS WHERE NAME = 'COMMERCEFULLTEXTCATALOG');
OPEN retail_ftx;
FETCH NEXT FROM retail_ftx INTO @RFTXNAME;
BEGIN TRY
WHILE @@FETCH_STATUS = 0
PRINT 'Refreshing Full Text Index ' + @RFTXNAME;
EXEC SP_FULLTEXT_TABLE @RFTXNAME, 'activate';
SET @RFTXSQL = 'ALTER FULLTEXT INDEX ON ' + @RFTXNAME + ' START FULL POPULATION';
EXEC SP_EXECUTESQL @RFTXSQL;
FETCH NEXT FROM retail_ftx INTO @RFTXNAME;
END
END TRY
BEGIN CATCH
PRINT error_message()
END CATCH
CLOSE retail_ftx;
DEALLOCATE retail_ftx;
-- End Refresh Retail FullText Catalogs
--Begin create retail channel database record--
declare @ExpectedDatabaseName nvarchar(64) = 'Default';
declare @DefaultDataGroupRecId BIGINT;
declare @ExpectedDatabaseRecId BIGINT;
IF NOT EXISTS (select 1 from RETAILCONNDATABASEPROFILE where NAME = @ExpectedDatabaseName)
BEGIN
select @DefaultDataGroupRecId = RECID from RETAILCDXDATAGROUP where NAME = 'Default';
insert into RETAILCONNDATABASEPROFILE (DATAGROUP, NAME, CONNECTIONSTRING, DATASTORETYPE)
values (@DefaultDataGroupRecId, @ExpectedDatabaseName, NULL, 0);
select @ExpectedDatabaseRecId = RECID from RETAILCONNDATABASEPROFILE where NAME = @ExpectedDatabaseName;
insert into RETAILCDXDATASTORECHANNEL (CHANNEL, DATABASEPROFILE)
select RCT.RECID, @ExpectedDatabaseRecId from RETAILCHANNELTABLE RCT
--End create retail channel database record
4) Stop the below 4 services
- World Wide Web Publishing Service
- Management Reporter 2012 Process Service
- Microsoft Dynamics 365 Unified Operations: Batch Management Service
- Microsoft Dynamics 365 Unified Operations: Data Import Export Framework Service
5) Rename the DB.
ALTER DATABASE AXDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO ALTER DATABASE AXDB MODIFY NAME = AXDB_Orig ALTER DATABASE AxDB2026 SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO |
6) Start the below 4 services
- World Wide Web Publishing Service
- Management Reporter 2012 Process Service
- Microsoft Dynamics 365 Unified Operations: Batch Management Service
- Microsoft Dynamics 365 Unified Operations: Data Import Export Framework Service
- reference from Microsoft: Import Database
