This commit is contained in:
2022-03-15 21:27:20 +00:00
parent f99bba70f6
commit d129192c9f
7 changed files with 38 additions and 15 deletions

View File

@@ -144,7 +144,8 @@ Everything is erased **except** the following items:
- Operations backup settings
- Operations notification settings
- Business logos
- Reports
- Reports (any missing stock report templates will be re-installed)
- Tax codes
These items are kept as this feature is typically used when people are evaluating AyaNova and are ready to start using it for real but want to keep the non business data settings and reports to save having to re-enter them again.

View File

@@ -24,6 +24,16 @@ If this is your first time starting AyaNova and it has no database set up yet, t
The _Generate sample data_ button in the evaluate page opens a dialog to select the quantity of sample data you wish to generate and set the time zone desired for the sample data to be generated within.
### Database will be erased
Seeding will trigger erasure of **all** data in AyaNova in order to return it to a clean state with the following exceptions.
- Global settings
- Operations backup settings
- Operations notification settings
- Business logos
- Reports (any missing stock report templates will be re-installed)
### Seed level
This setting controls the amount of data generated. The options are small, medium, large and huge. Each option will generate progressively _more_ data than the last. The actual types of data generated are the same, only the quantity differs.

View File

@@ -42,7 +42,13 @@ Be sure to have all staff carefully test all business processes they require in
### AyaNova 8 database will be erased
The V8Migrate plugin will erase all data including attached files in the AyaNova 8 database as the first step.
The V8Migrate plugin will erase **all** user entered data including attached files in the AyaNova 8 database as the first step with the following exceptions:
- Global settings
- Operations backup settings
- Operations notification settings
- Business logos
- Reports (any missing stock report templates will be re-installed)
There is no ability to synchronize or partially migrate only recent changes from v7; the migrate process entirely replaces the V8 data each time it's run.

View File

@@ -60,17 +60,11 @@ The location of these folders is also logged on server startup in the [server lo
### Restore the attachments
1. Identify the attachments data folder location
1. Identify the attachments data folder location. Check the [server configuration](ops-config-environment-variables.md) and identify the location of the attachment files. There are two ways this can be specified, either directly through the [AYANOVA_ATTACHMENT_FILES_PATH](ops-config-folder-user-files.md) setting or indirectly through the [AYANOVA_DATA_PATH](ops-config-data-path.md) setting in which case the attachments folder will be found in a folder called `attachments` inside the folder specified by the AYANOVA_DATA_PATH setting.
Check the [server configuration](ops-config-environment-variables.md) and identify the location of the attachment files. There are two ways this can be specified, either directly through the [AYANOVA_ATTACHMENT_FILES_PATH](ops-config-folder-user-files.md) setting or indirectly through the [AYANOVA_DATA_PATH](ops-config-data-path.md) setting in which case the attachments folder will be found in a folder called `attachments` inside the folder specified by the AYANOVA_DATA_PATH setting.
2. Erase the current contents of the attachments folder identifed above, it must be completely empty before the next step. Note: you do not need to erase any other folders that may also be in the data folder such as logs, backup or temp, only the attachments folder contents need to be erased
2. Erase the current contents of the attachments folder identifed above, it must be completely empty before the next step
Note: you do not need to erase any other folders that may also be in the data folder such as logs, backup or temp, only the attachments folder contents need to be erased
3. Unzip the contents of the attachments zip file into the attachments folder.
There will be a lot of folders with single letter of digit names contained within each other, this is normal, you will not see recognizable file names here. Be careful to ensure you are unzipping _into_ the attachments folder and not a sub folder, it's easy to accidentally unzip a higher level directory into the intended directory in which case you won't see any of your attachments in AyaNova until this is resolved.
3. Unzip the contents of the attachments zip file into the attachments folder. There will be a lot of folders with single letter of digit names contained within each other, this is normal, you will not see recognizable file names here. Be careful to ensure you are unzipping _into_ the attachments folder and not a sub folder, it's easy to accidentally unzip a higher level directory into the intended directory in which case you won't see any of your attachments in AyaNova until this is resolved.
### Restore the database

View File

@@ -136,7 +136,7 @@ namespace AyaNova.Biz
foreach (FileInfo file in di.EnumerateFiles())
{
if (file.Extension.ToLowerInvariant() == ".ayrt")
await r.ImportAsync(JObject.Parse(await File.ReadAllTextAsync(file.FullName)));
await r.ImportAsync(JObject.Parse(await File.ReadAllTextAsync(file.FullName)), true);
}
}
}

View File

@@ -63,7 +63,7 @@ namespace AyaNova.Biz
////////////////////////////////////////////////////////////////////////////////////////////////
//IMPORT
//
internal async Task<bool> ImportAsync(JObject o)
internal async Task<bool> ImportAsync(JObject o, bool skipIfAlreadyPresent = false)
{
//Report newObject = new Report();
@@ -78,7 +78,16 @@ namespace AyaNova.Biz
{
NotUnique = await ct.Report.AnyAsync(z => z.Name == newUniqueName);
if (NotUnique)
{
if (!skipIfAlreadyPresent)
newUniqueName = Util.StringUtil.UniqueNameBuilder(proposedName, l++, 255);
else
{
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger<ReportBiz>();
log.LogInformation($"Import report '{proposedName}' skipped due to already present in database.");
return true;
}
}
} while (NotUnique);

View File

@@ -568,6 +568,9 @@ namespace AyaNova.Util
//If we got here then it's safe to erase the attachment files
FileUtil.EraseEntireContentsOfAttachmentFilesFolder();
_log.LogInformation("Importing any missing stock Report templates");
await AyaNova.Biz.PrimeData.PrimeReportTemplates();
apiServerState.ResumePriorState();
_log.LogInformation("Database erase completed");