Live database sync to test database for daily testing and trainings

SUGGESTED

I am looking for solutions to copy our sage x3 production folder either nightly or live sync to another folder in the database.

This backup/synced database should be accessible through sage as well for testing, always with up to date information (nightly)

 

Currently, I have to have everyone off the Sage Server to be able to achieve this. Being that we run 24/7, the chance to do this is extremely rare. This “sync” project  would allow us to run every day nonstop in our live PROD folder, while having a secondary synced database ”BK-PROD” where we can test functions and data changes.

 

Any changes to the synced database "BK-PROD" would be overwritten by the new nightly “re-sync”

Any idea if this is possible?

  • 0

    We do it manually... Curios to see some automation on this.

  • 0 in reply to Martins de Almeida

    When you do this manually, do you still have to kick users out?

    I need to be able to keep the live folder running.

  • 0 in reply to handymanny

    Yes, we usually do it overnight, without users messing...

  • 0 in reply to Martins de Almeida

    Mind linking me or showing me how you achieved this?

  • 0

    We have configured Sage EM on SQL Server with AlwaysOn Availability Groups to have multiple secondary databases. We use them for testing but also have SEI pointed to them for reporting to offload the performance instead of having it run against production. 

  • 0 in reply to jnoll

    But does it covers the rest, I mean the other folder items, reports, etc? It's not only data... Sorry if I am wrong.

  • 0

    Hi,

    Have also interest on this point.

    One option could be (Not tested / validated) :

    • 1) Auto Task DOSSVG to create SVG
    • 2) Script to coyp Folder/X3_Pub/to Existing folder
    • 3) Auto Task DOSINTEG to integrate
    • 4) Auto Task : VALDOS (if needed)

    Mains issues :

    • Does not check if there is connected user / neither batch task running
    • Need to plan time margin to be sure that all task are terminated before starting the other one
    • Could take a lot of time depending on Folder size ...

    Other possibility :

    --> simulate Duplication button from Console (But not certain if we access to script/binary called by Console)

  • 0 in reply to Julien BARGETTO

    Hmm... as long as i can copy the data out, i can manually do the rest actually.

    I will try it this week... part 1 at-least.

    Thank Julien.

  • +1
    SUGGESTED

    I had to come up with something similar for our company after getting tired of spending late nights doing folder copy processes to spin up an active copy of our Production endpoint for training or testing. This is what I did.

    Each night a sage scheduled task DOSSVG creates a current copy of the SVG folder in the Production endpoint, then (after it is complete) on our host server we run a nightly windows scheduled task of a robocopy batch script that syncs the current production folder and x3_pub folder (along with SVG and TRT folder for long-term backup) and timestamps. After the copy the SVG folder in the parent folder is cleared in preparation for the next nights backup. A copy of my script is below:

    @echo off
    echo wscript.echo year(date) ^& right(100 + month(date),2) ^& right(100+day(date),2) > "%temp%\dateparts.vbs"
    for /f "tokens=1 delims=" %%a in ('cscript //nologo "%temp%\dateparts.vbs"') do set yyyymmdd=%%a
    echo Today is %yyyymmdd%
    robocopy D:\Sage\X3\folders\PROD\SVG D:\Sage\X3\folders\archive\SVG-%yyyymmdd% /S
    robocopy D:\Sage\X3\folders\PROD\TRT D:\Sage\X3\folders\archive\TRT-%yyyymmdd% /S
    robocopy D:\Sage\X3\folders\PROD D:\Sage\X3\folders\archive\PROD-copy /MIR
    robocopy D:\Sage\X3\folders\X3_PUB\PROD D:\Sage\X3\folders\archive\PRODX3PUB-copy /MIR
    del /s /q "D:\Sage\X3\folders\PROD\SVG\*.*"

    Once this is done, at any time I can just copy the endpoint folder and X3_PUB folder to their respective directory and rename them whatever I need to for the new endpoint, and run a folder import in Safe X3 console. I can do this while users are in Sage working as it does not interfere with the live production endpoint they are in.

    All that is required after is that you point the endpoint in sage to the new folder.

    If you need to import an already existing folder name you'll need to clear both the folder on the server and, in SQL, the tables, views, programmability>sequences, security>users, and security>schemas associated with the endpoint folder being replaced. (If you don't do this it will be trying to write tables over tables, etc on import.)

    Now, if you're talking about completely syncing to a live secondary endpoint, I am unsure if overriding the current secondary folder with a renamed copy of your primary folder would do what you want, as the Safe X3 console loads the data from the endpoint folder into sql, etc.

    At the very least this will greatly cut down on the amount of time it takes to refresh your secondary endpoint, we can spin up a copy in <1hr at any time of day.

    Note: Make sure there are no transactions or batch tasks scheduled during the time DOSSVG runs at night.