Backing up your assets library locally

In this tutorial, we will explain how to synchronize your assets library with your local Foundry installation.

Note: This synchronization is only done one-way. It currently downloads your assets library to the local folder. It will not sync your local folder to your Forge installation. The Asset Sync feature is intended as a way to backup your assets, and as a way to retrieve assets uploaded to The Forge.

If you want to synchronize your local assets to your assets library, use the Import Wizard. We use the term “synchronization” because, after the initial download of your assets, only new and changed assets will be re-downloaded. This helps keep the synchronization faster than a full re-download.

The synchronization tool currently has other limits, as well. For security reasons, Foundry will not let you overwrite local files that are not media files, so a file with no extension or a .js file, etc… will not be overwritten. This should not be an issue as the assets library is meant primarily for media files (audio, video, images), so you will rarely encounter that issue.

Similarly, the synchronization tool will not overwrite existing local files, unless you tell it to. If it detects that a local file matches the remote file, changing the name of the file in your assets library, and redoing a synchronization will update the local file as well. If both the local and remote file have changed, the file will not be overwritten.

How to synchronize your assets library

1 - Install and enable the Forge VTT module to your local Foundry installation
2 - Set your API key in the Forge module’s settings. Refer to this guide on how to do this. Note that you would only need the ability to read assets in the API key permissions.
3 - In the same module settings window, open the Asset Sync Tool by clicking the “Open Asset Sync” button:

image

4 - Click the Sync button and let it begin working:

image

If you make changes to your assets library after syncing it to your local Foundry folder, all you will need to do is open the sync tool and re-sync them again. After the first sync, it will (usually) be faster and more efficient in subsequent syncs. In the future, the asset sync will allow you to update your worlds as well, allowing you to export your content more easily, and play offline.

4 Likes

Looking forward to the local world asset re-point, that’ll be great too.

3 Likes

Hey there,

  • is there a milestone set fot updating the world?
  • Do I have to resync completely (forced) to activate the later coming use of Local Assets
  • 181/11779 assets and I started like 15 minuets ago. Be patient everybody :slight_smile:

Very nice feature I was looking forward to. Thanks!

Hi,

  • There’s no specific deadline set for it (I stopped doing deadlines, I always miss them, stress over them, and feel bad), but it’s for sooner rather than later.
  • Yes, you would resync but this is an assets sync not an assets download, and it took a while to write because we wanted you to be able to do the sync multiple times and it would just pick up any changes, without redownloading anything that hasn’t changed, so technically, the next time you do a sync, it should only take a few seconds to complete.
  • Yeah, initial sync can take a while, depending on how big your assets library is, hehe. We could probably optimize the download/upload portions to have it parallellized, but that’s a lower priority than other stuff.

Thanks!

Hey kakaroto, Alright sounds good to me. Thanks again for the (again fast) response. Have a nice weekend. After the 0.8.6 release I’m sure it’s a quite one :sweat_smile:

Hi!
An update to the Forge module was released a couple of days ago which adds support for the updating of worlds. It will also attempt to migrate entities in compendiums in your enabled modules, so hopefully the world becomes fully usable offline (unless it’s using references to someone else’s asset library or external links).
Please test it and let us know if you have any issues or feedback!
Thanks!

Hi!
Yeah, I’m now on story teller mow and uploaded (some) more assets now. Sooo I’m syncing another 30k assets right now and will test afterwards. Probably Saturday.
Will post any issues here or on discord.
Edit: with the speed of the sync right now it’ll be 25 hours till completion of the process. It’l be sunday or monday :sweat_smile:
Okay it skipped like 28k assets i synced earlier. The new feature synced with errors (expected ones). It shows the modules that the scene was using on the forge, but are not installed locally and shows external links as errors. Seems like it works as intended.

Console: Screenshot - 71c3d63396be29a9163975f2fc54ce18 - Gyazo

1 Like

I’m having trouble using this module. When I install it, I only see an entry field to enter the API Key and there’s no button to “Open Asset Sync”. I’m running Foundry VTT 0.7.9 via forge-vtt.com. In case it’s important, I’m not a Forge patreon, but I do have a paid forge account.

Here’s what I see in the settings:

I’ve tried entering an API key and restarting the game, but the Forget settings are the same (can only enter API Key with no Open Asset Sync button).

I initially tried using the 1.11.0 version of The Forge module and then uninstalled that and install the 1.10.2 version, but both looked the same in the Foundry module settings.

That option is only available when you run the Foundry app locally or on a server that isn’t hosted on the Forge, since you cannot sync your Forge assets to the Forge itself (all the assets are already there!).

That’s what I was missing, thanks!

Seemed to work pretty good and fast (I have a fast connection).

I know you eventually want to provide 2-way sync for assets. I’m wondering if you’re considering doing the same for modules & settings. In my ideal world, I’d love to develop/configure everything about my world locally and then push all my changes to Forge when I’m ready to play with my group.

That’s what the import wizard does. It’s used for syncing back in the other direction, from local back into the forge.

I’m using “Update Foundry World & Compendiums to use Local Assets.” Synchronization is happening now as I type this. Just so I understand the process:

  1. Asset Sync accounts all the world’s stat blocks, compendiums, etc.
  2. Asset Sync compares every local asset to the accounted references and updates each reference to match the assets’ local position.

Is my assumption correct? I wonder because the process shows a systematic “[asset file] saved to [local asset directory]” and I know each of those files already exist. Asset Sync is not overwriting the same file, is it? I presume no, so I suppose it’s actually comparing each and every asset to file references and syncing (changing forge.vtt references to local) as it goes.

Synchronization is complete and result is outstanding! The process took a long time, given how many files I have, and I’m thankful for the automation.

However, I noticed most (maybe all) items from compendiums still refer back to the Forge:
Screen Shot 2021-09-06 at 12.35.07 PM

In this example, my local installation has systems/dnd5e/icons and all the same files. I thought Forge synchronization updates compendium files too, no?

I will report this back.
I recently noticed this with spaced folders, but seems you’ve gotten it on a non-spaced world too.

A post was split to a new topic: Help backing up assets library

I am running into an issue with failure as soon as I try to sync:

GET https://<my-domain>/forge-assets.json 404 (Not Found)

Error: Forge VTT | Asset Mapping file not found, but will be created with a successful sync.
    at ForgeAssetSync.fetchAssetMap (assets-sync.js:551:31)
    at async ForgeAssetSync.sync (assets-sync.js:109:37)
    at async ForgeAssetSyncApp._onClickSyncButton (assets-sync.js:990:13)

assets-sync.js:992 TypeError: error.match is not a function
    at ForgeAssetSync.buildLocalInventory (assets-sync.js:476:27)
    at async ForgeAssetSync.sync (assets-sync.js:123:31)
    at async ForgeAssetSyncApp._onClickSyncButton (assets-sync.js:990:13)

Any suggestions on fixing this? The instance is cloud hosted, and on v11. Does it have to do with this module being only v10?

I’m not sure, first time I’m seeing that error. Will see if it’s v11 specific and fix it.
The first one about the missing json file and “Asset mapping file not found” is normal, and will happen the first time you do a sync (it should really not show it as an error).

HELP?!? All I am getting are empty folders!


Screenshot 2023-09-30 at 15.44.18

Hey there @yenbengrey

I’ve responded to your ticket on Discord. It looks as if the Foundry FilePicker is returning an error when attempting to create the specific folders required for your assets. It’s possible that this is an OS level restriction, but this has been reported by a few other users as well.

We are in the process of attempting to replicate the issue to try to resolve it. If you could please share a read-only API key privately, that would help us greatly to replicate and fix the issue, thank you!

3 posts were split to a new topic: Paths referenced in compendium modules point to The Forge