{"id":8770,"date":"2023-06-05T01:18:18","date_gmt":"2023-06-05T01:18:18","guid":{"rendered":"https:\/\/www.use-snip.com\/kb\/?post_type=ht_kb&#038;p=8770"},"modified":"2023-06-05T01:18:18","modified_gmt":"2023-06-05T01:18:18","slug":"import-export-user-accounts","status":"publish","type":"ht_kb","link":"https:\/\/www.use-snip.com\/kb\/knowledge-base\/import-export-user-accounts\/","title":{"rendered":"Import-Export User Accounts"},"content":{"rendered":"<p>This article explains <em>exporting<\/em> and <em>importing<\/em> User Accounts in the <span style=\"color: #0000ff;\"><strong>SNIP<\/strong><\/span> Caster. Each process is considered in turn.<\/p>\n<h2><strong>Exporting User Accounts<\/strong><\/h2>\n<p>This is a simple one-step process.\u00a0 From the Manger User Accounts dialog (displayed with the menu command <strong>Setup<\/strong> \u21d2 <strong>Manage User Accounts\u2026<\/strong> ), press the <strong>Export User Accounts<\/strong> tool button at the far right of the dialog.<\/p>\n<p><a href=\"https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/ExportUsersButton.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8767 size-full\" src=\"https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/ExportUsersButton.png\" alt=\"\" width=\"275\" height=\"200\" srcset=\"https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/ExportUsersButton.png 275w, https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/ExportUsersButton-50x36.png 50w\" sizes=\"auto, (max-width: 275px) 100vw, 275px\" \/><\/a><\/p>\n<p>An export file is created from the current internal User Account file representation with all the details of every current user account.\u00a0 A summary of the action is also displayed in the console log. \u00a0Note that the name used for the file is auto-generated and contains a date-time stamp in order to tell different exports apart.<\/p>\n<pre>[USRS]:\u00a0\u00a0 Exported 1 User Accounts, file is 4.63 KB long.\r\n  File at: C:\/Program Files (x86)\/SNIP\/bin\/UserAccounts_2023_06_03_11_21_30.txt.\r\n\u00a0 You can edit this file and import it when done.\r\n\u00a0 Or you can import and merge another file to add users.<\/pre>\n<p>This is an ASCII only \u00a0text file using a tab delimited output style. \u00a0Each line ends with &lt;CR&gt;&lt;LF&gt;. \u00a0There is one row for every User Account.\u00a0 Each row has 49 columns of data to cover all the various user account restrictions that may be present.\u00a0 Most of these fields will be blank, and can be left empty (in most user accounts they are not used).\u00a0 As a rule, any empty field produces a safe \u201cnot used\u201d result when imported.\u00a0 Only a few fields are required to be present, such as the User Account Name and password (and these are all documented in the header).<\/p>\n<p>Comments and meta information are found on lines which start with \u201c##\u201d \u00a0\u00a0The first ~75 lines document the formats used and the meaning of each field.\u00a0 A trivial entry example is shown below for the user account \u2018bob\u2019 which has the password \u2018none\u2019 and which can connect up to 5 simultaneous times at once. There are no restrictions present on the account (and it has never connected).<\/p>\n<pre>UA042289\u00a0\u00a0 CA000000\u00a0\u00a0 bob\u00a0 P\u00a0\u00a0\u00a0 none 5\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0 01-01-2000\u00a0\u00a0\u00a0\u00a0 00:00:00\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 01-01-2000 00:00:00\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 User-Active\u00a0\u00a0\u00a0\u00a0 Off\u00a0 02-06-2024\u00a0\u00a0\u00a0\u00a0 00:00:00\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 EndTimeMsec=1717311600000\u00a0 Off\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 timeP=0,timeU=0,autoRandE=0,emailOnAdd=1,emailOnPast=1,emailAt20=1,emailAt50=1,persistUntilD=0\u00a0\u00a0\u00a0\u00a0 Off\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 regionType=circle,cirPtLat=0.0000,cirPtLon=0.0000,radius=25.000,rectN=0.0000,rectS=0.0000,rectE=0.0000,rectW=0.0000\u00a0\u00a0\u00a0\u00a0 Off\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 UseCaseSens=1\u00a0\u00a0 Off\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NoNearPassThrough=0\u00a0 Off\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Off\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 End<\/pre>\n<p>It is possible to read this file with any text editor, we would recommend Notepad++ (see <a href=\"https:\/\/notepad-plus-plus.org\/\" target=\"_blank\" rel=\"noopener\">https:\/\/notepad-plus-plus.org\/<\/a>) which has several nice alignment features \u00a0for tab formatted files.\u00a0 You can also read the text with Microsoft Excel (importing it as a tab separate file), but use caution that it does not damage your data with auto formatting (especially where dates and times are concerned).<\/p>\n<p style=\"text-align: left; padding-left: 40px;\"><span style=\"color: #008000;\"><strong>Hint<\/strong><\/span>: The best way to understand the formatting used with the more complex restrictions is simply to create a User Account with that type of restriction and export it.\u00a0 The format used for those fields will then be obvious. In case of complex questions; please just contact us for support in the normal way. Keep in mind that <span style=\"color: #0000ff;\"><strong>SNIP<\/strong><\/span>, like most GNSS tools, uses UTC time internally (not the local time zone). And also that the order of dates and time is typically expressed as yyyy-mm-dd-hh-mm-ss.sss. So a date like July 1<sup>st<\/sup> 2023 would be 20230701.<\/p>\n<p>The exported file can then be edited in various ways or used as a data source to drive other back-office processing scripts. In the export step some additional historical usage data items are also present to aid in creating offline reports (for example the last connection time, IP used, and mountPt used).\u00a0 That data is not read back in when\/if the file is imported.<\/p>\n<p style=\"padding-left: 40px;\"><span style=\"color: #008000;\"><strong><em>Aside<\/em><\/strong><\/span>: The <a href=\"https:\/\/www.use-snip.com\/kb\/knowledge-base\/backing-up-your-snip-deployment\/\">backup process<\/a> also makes a copy of the current User Account file when run.\u00a0 That file is in the format used internally by <span style=\"color: #0000ff;\"><strong>SNIP<\/strong><\/span> and is not easily edited by hand.\u00a0 Exporting translates various binary details into a textual format and produces a file that humans can edit.<\/p>\n<h2><strong>Importing User Accounts<\/strong><\/h2>\n<p>Importing User Accounts is a more complex process that involves two basic steps:<\/p>\n<ol>\n<li>A pre-import validation process to check the records, and<\/li>\n<li>The import itself using the options you have set to resolve any conflicts.<\/li>\n<\/ol>\n<p>The import process is started as follows. \u00a0From the Mange User Accounts dialog (displayed with the menu command <strong>Setup<\/strong> \u21d2 <strong>Manage User Accounts\u2026<\/strong> ), press the <strong>Import User Accounts<\/strong> tool button at the far right of the dialog.<\/p>\n<p><a href=\"https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/ImportUsersButton.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8769 size-full\" src=\"https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/ImportUsersButton.png\" alt=\"\" width=\"275\" height=\"180\" srcset=\"https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/ImportUsersButton.png 275w, https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/ImportUsersButton-50x33.png 50w\" sizes=\"auto, (max-width: 275px) 100vw, 275px\" \/><\/a><\/p>\n<p>A dialog is then presented where you can select the file to import the User Accounts from.\u00a0 We presume you have created this file beforehand. Import files do not need to have or use \u201c##\u201d for comment lines. But it\u00a0 can be convenient to start a \u201cproblem entry\u201d with \u201c##\u201d when debugging an import file.<\/p>\n<p>After this, an Import Setting dialog is presented (shown below) where you can control details of how the file will be processed.<\/p>\n<p><a href=\"https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/Impt-ExptUsersDialog.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8768 size-full\" src=\"https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/Impt-ExptUsersDialog.png?_t=1685924872\" alt=\"\" width=\"490\" height=\"450\" srcset=\"https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/Impt-ExptUsersDialog.png 490w, https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/Impt-ExptUsersDialog-300x276.png 300w, https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/Impt-ExptUsersDialog-50x46.png 50w, https:\/\/www.use-snip.com\/kb\/wp-content\/uploads\/2023\/06\/Impt-ExptUsersDialog-320x294.png 320w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/a><\/p>\n<p><span style=\"color: #008000;\"><strong>TIP<\/strong><\/span>:\u00a0 When testing a new import file it is generally best to UNcheck the group box marked \u2018Import All Valid Entries\u201d and run the Validation section (one or more times) to determine what, if any, errors may be in the source file &#8211; correcting them as you go. \u00a0After you are satisfied with the results, then check the Import box and perform the actual import.\u00a0 The process is started by pressing the <strong>Start<\/strong> button.<\/p>\n<h3><strong>General Remarks<\/strong><\/h3>\n<p>Both sections can be <em>enabled<\/em> or <em>disabled<\/em> from running, although \u00a0it is customary to disable the import step and run the validate step one or more times; correcting the source text as errors are reported.\u00a0 In each section there is a check box marked \u201c<strong>Show details in console log<\/strong>\u201d that, when enabled, will place any report errors or action into the log.\u00a0 A similar check box marked \u201c<strong>Show source entry in reports<\/strong>\u201d will, when checked, cause the current source user entry to also be placed in the logs. \u00a0These reports number the target source file lines for reference.\u00a0 Each line of the source file line can be very long, so they may appear on the screen as word-wrapped and therefore harder to read (this depends on the word-wrap check box you have selected for the console controls). \u00a0The combo button marked \u201c<strong>To Clipboard, as Plain Text<\/strong>\u201d or \u201c<strong>To Clipboard, as html<\/strong>\u201d can be used to place the entire report (in the selected format) on the clipboard for easy copy\/paste into the editor of your choice.\u00a0 A progress bar is shown during the process, although for all but very large files (thousands of users) the entire process take only a few seconds unless one of the above check boxes is selected, which may result in many console log entries.<\/p>\n<h3><strong>Validate Entries, Controls Settings<\/strong><\/h3>\n<p>This section controls the pre-processing used to check entries.\u00a0 In general it should be enabled. When run (when \u201c<strong>Start<\/strong>\u201d is pressed) it will process the entire file.\u00a0 Many error types will result in the user entry (the row) being skipped, and the entry as the what was wrong placed into the log.\u00a0 A few error types will cause the entire file to be rejected, and the import step will not be processed (regardless of if checked or not).\u00a0 This typically occurs when a file is selected that is not a composed of User Accounts.\u00a0 Each User Account line is required to have the correct number of tab delimited entries, even when they are all empty (currently 49) and end with &lt;CR&gt;&lt;LF&gt;.\u00a0 \u00a0The report of errors contains extensive notes on what error(s) were found.<\/p>\n<h3><strong>Import Entries, Control Settings<\/strong><\/h3>\n<p>The actual step of importing the new User Entries has two important settings:<\/p>\n<ul>\n<li>A \u201c<strong>Clear<\/strong>\u201d checkbox that removes all existing entries before starting the process.<br \/>\n[The check box marked \u201c<strong>Clear all existing entries before import<\/strong>\u201d]<\/li>\n<li>A \u201c<strong>Overwrite<\/strong>\u201d or <em>Skip<\/em> checkbox that controls how any entries that match an existing entry are handled.<br \/>\n[The check box marked \u201c<strong>Overwrite any Matching Entries<\/strong>\u201d]<\/li>\n<\/ul>\n<p>These are used to control the import process, for example:<\/p>\n<ul>\n<li>If you wish to <em>Replace all current entries with the new file<\/em>,<br \/>\nDO check the clear box, the overwrite box can be checked or not.<\/li>\n<li>If you wish to <em>Add all current entries in the new file, keeping older entries<\/em>,<br \/>\nDO NOT check the clear box, and do NOT check the overwrite box.\u00a0 Any new entries (user accounts that do not yet exist in the system) will be added.<\/li>\n<li>If you wish to <em>replace all current entries with the new file AND update those that may match existing entries<\/em>,<br \/>\nDO NOT check the clear box, and DO check the overwrite box.\u00a0 Any new entries (user accounts that do not yet exist in the system) will be added. \u00a0Any new entries that match with an existing entry will replace (overwrite) the existing entry.<\/li>\n<\/ul>\n<p>The process is started by pressing the <strong>Start<\/strong> button.\u00a0 The result is shown in the console log (any on the clipboard).\u00a0 The number of User Account entries and also shown.\u00a0 The new\/updated User Accounts will be used by the Caster immediately thereafter.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article explains exporting and importing User Accounts in the SNIP Caster. Each process is considered in turn. Exporting User Accounts This is a simple one-step process.\u00a0 From the Manger User Accounts dialog (displayed with the menu command Setup \u21d2 Manage User Accounts\u2026 ), press the Export User Accounts tool [&hellip;]<\/p>\n","protected":false},"author":13,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"ht-kb-category":[283],"ht-kb-tag":[535,71,178,495],"class_list":["post-8770","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-managing-user-accounts","ht_kb_tag-export","ht_kb_tag-import","ht_kb_tag-new-users","ht_kb_tag-user-accounts"],"_links":{"self":[{"href":"https:\/\/www.use-snip.com\/kb\/wp-json\/wp\/v2\/ht-kb\/8770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.use-snip.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.use-snip.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.use-snip.com\/kb\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.use-snip.com\/kb\/wp-json\/wp\/v2\/comments?post=8770"}],"version-history":[{"count":6,"href":"https:\/\/www.use-snip.com\/kb\/wp-json\/wp\/v2\/ht-kb\/8770\/revisions"}],"predecessor-version":[{"id":8776,"href":"https:\/\/www.use-snip.com\/kb\/wp-json\/wp\/v2\/ht-kb\/8770\/revisions\/8776"}],"wp:attachment":[{"href":"https:\/\/www.use-snip.com\/kb\/wp-json\/wp\/v2\/media?parent=8770"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.use-snip.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=8770"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.use-snip.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=8770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}