clone or copy my instance self hosted

Lion Kesler
Tera Contributor

Hello everyone,

I want to multiply the my instance  - table, columns, script, forms But not the data 

another problem - my instance not connected to the internet.

and the destination instance not connect to source instance  (I need a solution using files)

 

Thanks

 

1 ACCEPTED SOLUTION

Matyas Tichy
Kilo Expert

Hello Lion,

 

The simplest, unfortunately time consuming (first time you do it), way is using mysqldump (mariadb-dump) utility and leveraging it's "--no-data" and "--no-create-info" variables.

The mysqldump documentation can be found here: https://mariadb.com/kb/en/mariadb-dumpmysqldump/ 

 

You would do mysqldump with --no-data variable for entire schema this will preserve entire structure - so you'd have all tables and columns in the target instance.

 

And you would do another mysqldump or series of them with --no-create-info for all the tables except those you want to leave empty. Be careful when you are choosing to skip any of the tables though. As there are thousands of tables this can take some time to identify 90% of what you could leave empty. To simplify this process I recommend you start by tables well known to you (e.g. you have table u_my_records containing some very important records you have made in production then you know you can empty it), then follow it up with largest tables (both by size and number of records) and so on. I suggest you leave all of the system or unclear tables as are. The only exception I can think of would be user tables, and attachments. For some table hierarchies you can also simplify by using wildcards to skip children tables as well. 

 

When you are satisfied with the list you make thos dumps, import them to target DB, follow the remaining steps needed for self-hosted cloning (e.g. disabling some properties or chaning instance id,name) and you should have the instance almost as you wanted.

You can cleanup remaining data either through the application (e.g. system tables) or in case you still find large table that can be completely emptied, you can truncate it via DB host.

 

If you retain your filters, next copy should be cleaner and a lot faster.

I hope this helps.

Matyas

View solution in original post

5 REPLIES 5

Community Alums
Not applicable

Hi @Lion Kesler ,

First of all you need internet, else how are you suppposed to start the connection!!

Lets say you have a source instance as (https://source.servicenow.com)
And a target instance as (https://target.servicenow.com)

Step#1: To create a Clone Target, Login into your instance which needs to be cloned.
Navigate to System Clone > Clone Targets. Click New.

Create a new record like:

SandeepDutta_0-1671335581771.png

 

 

Step#2: To start the clone process
Navigate to System Clone > Request Clone.
Select a Target instance to receive the cloned data.

SandeepDutta_1-1671335581640.jpeg

 

Step#3: Confirmation message you would see:

SandeepDutta_2-1671335581863.png

 

SandeepDutta_3-1671335581792.png

 

 

Step#4: Check the clone progress (System Clone > Active Clones and select a request):

SandeepDutta_4-1671335581804.png

 

MOST IMPORTANT:  Be careful about your source & target instance, you would always go to sourcing instance to make a clone instance.

Hi

There is no communication between the Instances’

They are in two different domain and can not be connected 

Kashyap Gundepu
ServiceNow Employee
ServiceNow Employee

@Lion Kesler 

 

Please see if this helps:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0752547 

(You need to have a valid HI/Support account to view this article.)

The solution you have given me copies all of the tables and the data inside, I just want the tables with NO data inside