Jump to:

23370 Posts in 18160 Topics by 2864 members

General Questions

SilverStripe Forums » General Questions » Synchronizing FTP Files and Images in the Folder /asset

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1828 Views
  • davidm2010
    Avatar
    Community Member
    107 Posts

    Synchronizing FTP Files and Images in the Folder /asset Link to this post

    For those who FTP files to your asset folder or change its strucutre, here is a tip for you. Maybe you know, but I didn't and just about destroyed my site database.

    Go to http://www.mysite.com/dev

    There you get a selection of all of the utilities that are at your disposal. Very important and useful.

    Here is the dev utility list:

    •/dev/build: Build/rebuild this environment. Call this whenever you have updated your project sources
    •/dev/buildcache: Rebuild the static cache, if you're using StaticPublisher
    •/dev/tests: See a list of unit tests to run
    •/dev/tests/all: Run all tests
    •/dev/tests/startsession: Start a test session in your browser (gives you a temporary database with default content)
    •/dev/tests/endsession: Ends a test session
    •/dev/jstests: See a list of JavaScript tests to run
    •/dev/jstests/all: Run all JavaScript tests
    •/dev/tasks: See a list of build tasks to run
    •/dev/viewcode: Read source code in a literate programming style

    Select the /dev/tasks link. Here you get:

    •Sync Files & Images assets
    The Files & Images system in SilverStripe maintains its own database of the contents of the assets/ folder. This action will update that database, and should be called whenever files are added to the assets/ folder from outside SilverStripe, for example, if an author uploads files via FTP.
    •Forum Database Migration
    Upgrades your 0.2 forum version to the 0.3 structure
    •i18n Textcollector Task
    Traverses through files in order to collect the 'entity master tables' stored in each module.
    •Database Migrations
    Provide atomic database changes (not implemented yet)
    •Flush Generated Images Task
    Remove all cached/generated images created as the result of an image manipulation
    •Encrypt all passwords tasks
    Convert all plaintext passwords on the Member table to the default encryption/hashing algorithm. Note: This mainly applies to passwords in SilverStripe 2.1 or earlier, passwords in newer versions are hashed by default.
    •Migrate SiteTree Linking Task
    Rewrites plain internal HTML links into shortcode form, using existing link tracking information.
    •Migrate Translatable Task
    Migrates site translations from SilverStripe 2.1/2.2 to new database structure.
    •Upgrade SiteTree Permissions Schema
    Move data from legacy columns to new schema introduced in SilverStripe 2.1.
    SiteTree->Viewers to SiteTree->CanViewType
    SiteTree->Editors to SiteTree->CanEditType
    SiteTree->ViewersGroup to SiteTree->ViewerGroups (has_one to many_many)
    SiteTree->Editorsroup to SiteTree->EditorGroups (has_one to many_many)
    See http://open.silverstripe.com/ticket/2847
    •UserForms Database Migration
    Upgrades your current forms to the latest structure
    •UserForms Versioned Initial Migration
    Publishes the existing forms

    If you pick the first one, it will reindex all of your asset files and make SS behave correctly.

    I hope this helps someone avert heartache and disaster.

    DM

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Synchronizing FTP Files and Images in the Folder /asset Link to this post

    Pretty sure this is the same task that is run by clicking the 'Look for new files' button in the assets section in the CMS. Slightly easier to find!

  • davidm2010
    Avatar
    Community Member
    107 Posts

    Re: Synchronizing FTP Files and Images in the Folder /asset Link to this post

    Assuming you can get to it. I was not able to open up the File and Images section. This I was able to do to get it corrected.

  • Stef87
    Avatar
    Community Member
    66 Posts

    Re: Synchronizing FTP Files and Images in the Folder /asset Link to this post

    I'm desperately looking for the way to call this from one of my CMS pages as I am adding images programmatically. Can anyone help me out?

    Thanks

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: Synchronizing FTP Files and Images in the Folder /asset Link to this post

    Filesystem::sync();

  • Stef87
    Avatar
    Community Member
    66 Posts

    Re: Synchronizing FTP Files and Images in the Folder /asset Link to this post

    Enormous thanks. You've saved me.

    1828 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.