Forums Archived

This forum has been archived. No new posts can be made and no new users can sign up. It remains here for reference only.

Find the new forums here

Backups in Minecraft module are extracted into wrong directory

  • 714 Views
  • Last Post 25 May 2018
fenriv posted this 23 May 2018

OS Name/Version: Debian 9.4

Product Name/Version: AMP Beta 'TN/SR5' 1.6.8.0 Minecraft module ForgeMod server installed from AMP configuration for Minecraft (14.23.3.1655 mc 1.12.2)

Problem Description: Backup are restored to a subdirectory of minecraft server directory. Instance dir: ~/.ampdata/instances// Minecraft dir: ~/.ampdata/instances//Minecraft Backup restore dir: ~/.ampdata/instances//Minecraft/MinecraftModule As result, restoring of a backup is having no effect on the instance.

Steps to reproduce: 1. Create new backup 2. Go to backups and press "Restore Backup"

Expected result: MC server state is restored to the point of a time when the backup was taken (and current state is moved to ./trash subdir).

Actual result: MC server state remaining as it was before restoring the backup.

Actions taken to resolve so far: SSH to server and move files from MinecraftModule dir to one directory higher in hierarchy.

Order By: Standard | Newest | Votes
fenriv posted this 25 May 2018

Had a little of time to look at the root of the issue and here's what I have found.

Inside LocalFileBackupPlugin in class BackupProvider there are two methods TakeBackup and RestoreBackup.
TakeBackup method is appending the ModuleName property value to the directory path in archive variable:

var directoryPathInArchive = ... ? manifest.ModuleName : Path.Combine(manifest.ModuleName, fileInfo.Directory.FullName.Substring(directoryInfo.FullName.Length));

while RestoreBackup is just running extraction:
zip.ExtractAllAsync(this.SourcePath, ExtractExistingFileAction.OverwriteSilently, task);

where SourcePath is
this.SourcePath = this.settings.Storage.OverrideOriginDirectory ? this.settings.Storage.OriginDirectory : app.BaseDirectory

The code is generated, but should be close to what actually going on within the assembly. I hope this helps with an investigation.
Cheers.

Mike posted this 25 May 2018

Thanks I will look into it.

Close