How to move the workflow from one instance to other by XML(not updateset)?

snehalmadakatti
Mega Expert

Hi There,

Can any one help on how to move the workflow from one instance(a) to other instance(b)?

Note: I dont want to move the workflow by updateset and I know as per best practice we should move via updateset but I want solution via xml only.

I have tried to take the xml backup of all the following related tables of workflow and imported to other instance(b) but i am not able to see the workflow in workflow editor. I didnt follow any sequence while uploading the xml's so seems due to this issue is happening. Can anyone suggest on this how to fix...

1.wf_workflow_version

2.wf_stage

3.wf_activity

4.wf_condition

5.wf_transition

6.wf_workflow_instance

I got this list of wf related tables from the post :https://www.servicenowguru.com/graphical-workflow/exporting-graphical-workflows/

Thanks in advance.

Regards,

Snehal M

1 ACCEPTED SOLUTION

Ok, the table for that is "sys_variable_value".

Once data of this table is migrated scripts will appear. 


Raghav
MVP 2023

View solution in original post

13 REPLIES 13

@snehalmadakatti 

I would still recommend using the option of update set to move the workflows across the instance

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@ankur Though update sets is the best practice but there are situations where xml exports of wf are required

Raghav
MVP 2023

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Any specific reason not to use update set?

The recommended way of moving workflows from one instance to another would be to use Update Sets.

Due to the table relationships between the Workflow Version, Workflow Activity and Workflow Transitions, exporting an XML from a Workflow Version record can lead to unexpected behaviour when opening an imported workflow from the Workflow Editor.

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

the link you shared should help you achieve?

Did you try that?

Where are you stuck?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Snehal,

one more way you can try is this: not tested

1) go to this UI action -> Export Workflow

URL: https://instance.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=58681de03b301000dada82c09ccf3de6

2) Remove the condition of gs.hasRole('maint') & save the UI Action. By default it visible only for maint role

3) now visit your workflow version table -> "wf_workflow_version"

a) select workflow name

b) select Published as true

4) Now you see "Export Workflow" UI Action on bottom as related link

5) click on that

6) it would export workflow in xml and it downloads the xml file

7) now go to the next instance and visit "wf_workflow_version" table

😎 then import this xml

9) verify if workflow looks fine

Screenshots:

find_real_file.png

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader