Confluence site export & attachments seperately
Asked by Mike Rolls:

If I generate a confluence server site export without including attachments can I then restore the export onto a new data center instance and simply copy the original attachments folder to the new server location \& re-index?  
Will the imported pages still retain the association to the referenced files?

Thanks  
Mike


Answers:
author: Brant Schroeder
body: [@Mike Rolls](/t5/user/viewprofilepage/user-id/241433)

It sounds like you are looking to migrate your instance. If that is the case and you have a large number of attachments you should look at migrating the DB and home directory. <https://confluence.atlassian.com/doc/migrating-confluence-between-servers-184150.html>

As far as attachments go. If you have a space backed up to XML without attachments you will have to do some steps to recover those. My understanding is for the site backup still contains the same structure so moving the directory will work if the files are there before running the restore but you would want to test this. For larger migrations, I would suggest following the steps above instead of using a site backup.

comments: author: Mike Rolls
body: Hi Brant,  
I agree migrating the DB \& home dir would be preferable but the source \& host instances are at different versions \& the client's team are reluctant to upgrade the source instance to the target version or downgrade the target, migrate then upgrade.  
Crazy situation which is why the site import seemed to be the ideal solution as it it upward compatible.  
I'm assuming that restoring a database from an earlier instance will not work due to schema incompatibility.  

Thanks  
Mike


author: Brant Schroeder
body: [@Mike Rolls](/t5/user/viewprofilepage/user-id/241433) You are correct both instances need to be on the same version for that migration style to work. Are you able to snapshot your new instance just in case you have to roll back?


author: Utkarsh Agarwal _Nagarro_
body: Hi [@Mike Rolls](/t5/user/viewprofilepage/user-id/241433)

To fix the missing attachments post site import you can try and use the solution mentioned on the KB article: [How to restore multiple attachments from a file system backup in Confluence](https://confluence.atlassian.com/confkb/how-to-restore-multiple-attachments-from-a-file-system-backup-in-confluence-1044789300.html)

Kind Regards  
Utkarsh

comments: author: Mike Rolls
body: Hi Utkarsh,  
Thanks for the KB link - I'll review it.


author: Craig Castle-Mead
body: I'm guessing that if the team running the target instance are reluctant to match versions, then they have existing content you're trying to merge with, so you couldn't use the site export/import option anyway as it would overwrite the target instance.

We've used the process in the KB [@Utkarsh Agarwal _Nagarro_](/t5/user/viewprofilepage/user-id/188103) mentioned to resolve attachment issues after a large multi-space migration (unplanned issues), but you MAY be able to use this approach to your benefit. Absolutely check this on a non-production environment first, but if your space is expecting it's attachments to be in a folder (/foo), before you export, if you rename /foo to /foo.broken and run the export, the resulting export should contain only the XML of the space/contents and soft references to the attachments, but not the attachments itself. If you then import the XML to the target server, then use the <https://confluence.atlassian.com/confkb/how-to-restore-multiple-attachments-from-a-file-system-backup-in-confluence-1044789300.html> process to figure out what /foo should be, and put your attachments in the expected location, it may work.

CCM


Tags: confluence-server

server