Possible to transfer blocks from one site to another?

Permalink Browser Info Environment
I reported this as a bug but I shouldn't have. I didn't realize there were individual forums for each Add-On.

I have to recreate a website because some buggy crap happened that is just too much to deal with. So, I would like to NOT have to recreate the 8 Designer Content blocks I already made.

Is there an easy way to do this? I tried and failed. I'm hoping it's something simple and I just didn't know exactly where to put the blocks... but, it might be something to do with writing the database, in which case I'm probably screwed. Thanks.

Type: Discussion
Status: New
zoinks
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
Just copy the stuff inside your site's "blocks" directory to the new site's "blocks" directory (make sure you're in your site's top-level blocks directory, *NOT* in concrete/blocks).

After you've copied the block directories over, you'll need to install each one via Dashboard -> Add Functionality. Note that you will also want Designer Content installed (even though you don't need to use it to re-create these blocks or anything) otherwise the editing interfaces on some of them will be wonky.
zoinks replied on at Permalink Reply
zoinks
AMAZING! Do you know if it's possible to change the directory name? I would like to change "bio_block" to "leadership_bio_block" for example. Would this break it?

(I'm talking about changing the name PRIOR to uploading it to the /blocks directory and adding it through the Functionality panel)
jordanlev replied on at Permalink Reply
jordanlev
You can change the names (as long as it's before you install them via the Dashboard), but in addition to changing the name of the folder you also need to edit the controller.php file of the block and change the class name as appropriate. For example, if the folder was called "bio_block", the class name would have been BioBlockBlockController, but now if it's leadership_bio_block, the class name would be LeadershipBioBlockBlockController (basically, the TitleCase version of the folder name followed by "BlockController" -- kind of weird in your specific situation because you also have the word "block" in the block name, so you wind up with "...BlockBlock..." but that's okay, just something to watch out for).
zoinks replied on at Permalink Reply
zoinks
Hm, well I changed the directory and the class in controller.php but it still shows up as simply "Bios Block" in the Add Functionality panel. I haven't installed it yet. Is there something else I need to change? Perhaps $btName? I see $btTable also has the name in there as 'btDCBioBlock'...
jordanlev replied on at Permalink Reply
jordanlev
Oh yeah, change the "Name' ($btName). Don't worry about the database table -- it's okay for it to stay what it was (if for some reason you do want to change the database table name, though, you will ALSO need to go into db.xml and change it there too)
zoinks replied on at Permalink Reply
zoinks
Thanks again!!
jordanlev replied on at Permalink Reply
jordanlev
You're welcome! Good luck with the rebuild.
michaelDotco replied on at Permalink Reply
michaelDotco
My blocks aren't showing up in the add functionality section. They are being transferred as is from another site. Is there any reason for this?
jordanlev replied on at Permalink Reply
jordanlev
This is a general Concrete5 thing, not specific to "Designer Content". For whatever reason, they've split up the installation of addons (aka "packages") from the installation of custom blocktypes (which are *sometimes* part of an addon/package, but other times -- like if you create your own with Designer Content -- are on their own).

Long story short: go to Dashboard > Stacks & Blocks > Block Types, and install it from there.

-Jordan

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.