# Export/import projects, user database by command line

**URL:** <https://forum.inductiveautomation.com/t/export-import-projects-user-database-by-command-line/65731>\
**Category:** Ignition\
**Created:** [October 27, 2022, 3:40am UTC](https://forum.inductiveautomation.com/t/export-import-projects-user-database-by-command-line/65731 "2022-10-27T03:40:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [October 27, 2022, 3:40am UTC](https://forum.inductiveautomation.com/t/export-import-projects-user-database-by-command-line/65731/1 "2022-10-27T03:40:49Z")

</div>

I have a customer who has an on-premises gateway and a cloud gateway. Generally everything runs off the cloud, and the on-prem server has a different purpose in life, but in the event that the internet to their facility goes down, they want the ability to run up the same projects on their local server as a temporary "limp along until the internet comes back" measure.

I've developed everything such that all of the tag bindings will resolve correctly whether the project is running on the local server or the cloud server, so if I export a project from the cloud server and import it to the on-prem server, everything works as desired.

Is there a way to have a script automatically perform that export-import at scheduled times to ensure that any day-to-day development gets captured and copied across to the on-prem server, rather than relying on each contractor to do it manually? It doesn't look like the gwcmd utility can import/export projects, but perhaps if I knew which files to copy, I could set up a simple file copy script?

Could I also do this with the user data, so that all the same users, roles, and credentials are migrated across automatically?

Is there anything else I'd need to do to make this work the way I hope it will?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 27, 2022, 11:15am UTC](https://forum.inductiveautomation.com/t/export-import-projects-user-database-by-command-line/65731/2 "2022-10-27T11:15:51Z")

</div>

You should check out the Enterprise Administration Module.

---

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [October 27, 2022, 11:07pm UTC](https://forum.inductiveautomation.com/t/export-import-projects-user-database-by-command-line/65731/3 "2022-10-27T23:07:47Z")

</div>

Of course! I knew about that module but didn't think to use it for project synchronisation.

I'll take that to the customer - do you know if it's _possible_ to do it manually? I don't know what state their project budget is at, so I'd like to at least be able to tell them "you can buy a module to do exactly what you want for $X, or take the risk of building a custom unsupported solution yourself". I expect they'll get the EAM - it's not that expensive for just two gateways - but it's always good to give them options.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 28, 2022, 2:01am UTC](https://forum.inductiveautomation.com/t/export-import-projects-user-database-by-command-line/65731/4 "2022-10-28T02:01:36Z")

</div>

If you're on 8.x, projects are stored directly on the filesystem as regular directories. You can sync them however you want, though there's a default 5 minute scan rate they might confuse users at first.

---

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [October 28, 2022, 2:03am UTC](https://forum.inductiveautomation.com/t/export-import-projects-user-database-by-command-line/65731/5 "2022-10-28T02:03:07Z")

</div>

Terrific, thanks. What do you mean by a "default 5 minute scan rate"?

Is the user data stored in the file structure somehow as well, or will that be a manual operation (unless they go the EAM route)?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 28, 2022, 3:10pm UTC](https://forum.inductiveautomation.com/t/export-import-projects-user-database-by-command-line/65731/6 "2022-10-28T15:10:13Z")

</div>

What do you mean by "user data"?

A 5 minute scan rate meaning that, if you _do_ use filesystem operations to push projects between gateways, you won't _see_ those projects (or updates to those projects) for (worst-case) 5 minutes, because there's a constantly running job in the background that scans the `projects/` directory and compares it against the in-memory representation of the project(s). You can adjust that scan rate with a system flag: [Gateway Configuration File Reference - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Gateway+Configuration+File+Reference#GatewayConfigurationFileReference-ProjectDirectoryScanRate)

---

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [October 30, 2022, 11:03pm UTC](https://forum.inductiveautomation.com/t/export-import-projects-user-database-by-command-line/65731/7 "2022-10-30T23:03:33Z")

</div>

Got it. That's completely fine, 99.9% of the time nobody will be looking at that server, it's just an "in case of emergency" backup.

By "user data" I just mean the user accounts, roles, etc. If I created a new user on the cloud server, or changed a password for a user on the cloud server, is there a file I could copy over to the local server to have the new user show up there too (and the updated password for the other user)? Obviously the easiest way to do this would be by using external authentication like Azure AD, which is eventually the plan, but I just need to make them aware of the limitations here and now if they choose to do this manually.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 31, 2022, 3:22pm UTC](https://forum.inductiveautomation.com/t/export-import-projects-user-database-by-command-line/65731/8 "2022-10-31T15:22:53Z")

</div>

If you're using an "internal" user source, user and role information is stored in the internal database. Unfortunately, there's currently no easy way to selectively move _part_ of a gateway's configuration to another system - the only _supported_ way is with a gateway backup, which would restore _all_ of the gateway's configuration.

You can also use a user source that delegates to active directory, or uses a database:  
[https://docs.inductiveautomation.com/display/DOC81/Classic+Authentication+Strategy](https://docs.inductiveautomation.com/display/DOC81/Classic+Authentication+Strategy)

Perspective uses identity providers (IdPs); the Ignition gateway can act as an IdP (delegating authentication to a user source) or you can use a third party IdP.
