unable to perform full restore to new server
Asked by Mark Recoskie:

As a first step in upgrading our instance I'm migrating Confluence 5.4.4 running on CentOS 5.11 MySSQL 5.5.55 to Confluence 5.4.4 on CentOS 7.5 and PostgreSQL 9.4.19.

Steps:

1. Backup with attachments from Administration-\>Backup \& Restore on old system

2. Restore with Build Index to new system

Problem: none of the attachments get migrated to new install.

Test: restore the backup set to the old system (the one which was just backed up). Same problem, none of the attachments, custom icons etc are restored.

Please help.

Rafal


Answers:
author: Brant Schroeder
body: DB storage is deprecated. You should migrate the attachments from the DB to local storage. Then perform your backup and restore. If the files are not transferred then you can just copy the directory from the old server to the new server.

Information about attachment storage can be found here: <https://confluence.atlassian.com/doc/attachment-storage-configuration-166876.html>

comments: author: Mark Recoskie
body: Getting this error when attempting to switch attachment storage type to local:

2018-08-21 16:00:28,368 ERROR \[Long running task: Attachment data migration\] \[confluence.util.longrunning.AttachmentMigrationLongRunningTask\] runInternal  
-- url: /admin/doattachmentmigration.action \| userName: rafal \| referer: <http://docs.pikatech.com/admin/doeditattachmentstorage.action> \| action: doattachmentmigration  
java.lang.NullPointerException  
at java.io.File.\<init\>(Unknown Source)  
at com.atlassian.confluence.pages.persistence.dao.BootstrapAttachmentLocationResolver.getFileLocation(BootstrapAttachmentLocationResolver.java:18)  
at com.atlassian.confluence.pages.persistence.dao.FileSystemAttachmentDataDao.getConfluenceAttachmentDirectory(FileSystemAttachmentDataDao.java:56)  
at com.atlassian.confluence.pages.persistence.dao.HierarchicalFileSystemAttachmentDataDao.getConfluenceAttachmentDirectory(HierarchicalFileSystemAttachmentDataDao.java:74)  
at com.atlassian.confluence.pages.persistence.dao.FileSystemAttachmentDataDao.prepareForMigrationTo(FileSystemAttachmentDataDao.java:424)  
at com.atlassian.confluence.pages.persistence.dao.hibernate.AbstractHibernateAttachmentDao$IntraHibernateAttachmentMigrator.migrate(AbstractHibernateAttachmentDao.java:783)  
at com.atlassian.confluence.util.longrunning.AttachmentMigrationLongRunningTask$1.doInTransactionWithoutResult(AttachmentMigrationLongRunningTask.java:79)  
at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)  
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)  
at com.atlassian.confluence.util.longrunning.AttachmentMigrationLongRunningTask.runInternal(AttachmentMigrationLongRunningTask.java:74)  
at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:26)  
at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:35)  
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)  
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)  
at java.util.concurrent.FutureTask.run(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)


author: Brant Schroeder
body: That is a common issue - <https://confluence.atlassian.com/confkb/migrating-attachments-from-database-to-file-system-fails-with-transaction-log-full-exception-781392542.html>

Since you are migrating large files from the DB you may need to increase the amount of RAM allocated to the instance.


author: Mark Recoskie
body: This is a different error. The one you pointed out refers to problem with transaction log in MSSQL sever where as my issue is a null pointer exception error thrown by java.IO.File, perhaps missing folder or file reference? (I created both attachments and backup folders just in case that was the issue).

In addition, current system has 4GB of RAM and the full backup set with attachments is only about 4MB in size (double the recommended amount). Most attachments are small pngs and pdfs. Should be more than enough RAM for such small instance.


author: Brant Schroeder
body: Sorry sent the wrong link. This is the one you need. [https://confluence.atlassian.com/confkb/confluence-throws-nullpointerexception-when-migrating-attachments-from-database-to-filesystem-933097621.html](https://confluence.atlassian.com/confkb/confluence-throws-nullpointerexception-when-migrating-attachments-from-database-to-filesystem-933097621.html??)

This tells you how to update the config file to point to the correct attachments location.


author: Mark Recoskie
body: That was it. Thanks for the help!


author: Vickey Palzor Lepcha
body: Try restoring Attachment separately - don't make it a part of your backup.

After you restore your confluence - try copying the attachments separately to your new server.

comments: author: Mark Recoskie
body: what is the location of attachments on the file system?


author: Vickey Palzor Lepcha
body: umm under your home directory ...would look something like this;

.........\\application-data\\confluence\\attachments\\


author: Mark Recoskie
body: That would be simple. I don't have that folder in my original install. Also, Admin-\>Attachment Storage is set to In Confluence's configured database