There are lots of ways to export configuration from one Drupal site and import into another; however, there are few ways to do the same with content. Here's a quick tip which has worked well for me.
I've tried several contrib modules to export content from one site and import into another, with varying levels of success, such as Node export and UUID Features. However, in my use cases, these solutions created more problems than they solve.
For example, on one project I have to create Webform nodes in a development environment, and then export these into code so they can be deployed upstream. After wrestling with the modules above, I wrote a simple script you can execute at /devel/php:// Enter node NID to export.
$nid = 55;
// Use Drupal's export utility to convert the object to code.
include_once DRUPAL_ROOT . '/includes/utility.inc';
$export = drupal_var_export(node_load($nid));
// Strip node NIDs and VIDs, so it imports cleanly.
$export = preg_replace("/'(n|v)id' => '?\d+'?,/", "'$1id' => NULL,", $export);
// Print code needed to import node.
dpm('$node = ' . $export . ';' . "\n" . 'node_save($node);');
You can then include the displayed code in your .install file. It will create the node, and let Drupal auto-populate the NID and VID.Submitted by Joel Stein on May 7, 2014.Tags: Drupal Planet, Drupal, Drupal 7
Drupal is right in the middle of web technology, an ideal integrator of all kinds of things. Just like PHP itself it may be clunky here and there but it is a very efficient tool to build great experiences. And even if you are a great JS developer or a pro PHP person, maybe you have mad debugging skills, you always have something to learn. Now there are great books, sometimes even better videos, but nothing beats hands-on learning. When you get together with other people working on the same thing you learn so much about how they work and even if you gain no new knowledge about programming per say, you learn new tricks and ways to achieve things:
Two days working with the Drupal Community in #DrupalDevDays help you to learn more than one week working alone at home :)
— Javi Santos (@javisr) March 27, 2014
Not only that but you can also look into how the tools you work with are made and that all of us are human:
Greatest thing about code sprints: Hearing respected core devs say "I don't understand that." "Me neither." We all learn. #drupaldevdays
— Marc van Gend (@marcvangend) March 28, 2014
Finally, by helping to improve the tools you use, you gain much better knowledge about them. Close to the start of my web involvement I worked a lot on translating the PHP documentation to Hungarian and I got into Drupal fixing core issues for translations. By becoming one of the thousands building the system you use you also gain more credibility when you are looking for help in your weak areas as well:
— aboros (@hunaboros) March 27, 2014
But not everyone can do this right? You need to be a professional programmer and pay expensive fees to get into events? Wrong! So wrong! There are always sprints around the globe and more and more local Drupal events are announced every day. Starting out with a simple issue on a one day sprint is a great start. Drupal can always be improved in all kinds of ways whether that is accessibility testing, documentation, perfecting button colors and radiuses or finding and documenting bugs. All of those are great contributions.
Drupal Dev Days sprint photo by Amazee Labs
The best places to immerse yourself in contribution are multi-day sprints though. If you have any opportunity to go to those, I would definitely suggest you join one. Why? It takes a fair bit of time to get set up, understand the issue, start providing a solution and even though at the end of the one day sprint, you will promise to get back to it a week later from home, it is almost certainly not going to happen. There is nothing wrong with you, you just have other priorities when you get out of sprint-mode. So for ideal involvement pick a multi-day sprint. It is not only that you have more time to work on things, you can get to know the people better as well on the social events. Some conferences, especially DrupalCons include extended sprints before/after the event. If you just go to the main conference days, you have much less chance to interact with people who shape the future of Drupal, while at the extended sprints, you can get involved and work with them real time. How is that for growing your potential?
Here are some examples of events with multi-day sprints where my friends from the multilingual initiative will be sprinting, feel free to add more in the comments:
DrupalCamp Spain in Valencia is coming up in a little over a week on May 16-18th. All three days have sprinting opportunities and some of the leaders from multilingual, frontend and migrations will be there!
Some people may only be aware of the Friday sprint at DrupalCons. Get a lot more out of the event by being involved with the pre and post sprints as well. DrupalCon Austin sprints last from as early as May 30 to as late as June 8th. Likewise DrupalCon Amsterdam sprints will be on from the 27th of September to as late as 5th of October. But DrupalCons are expensive, no? Well, there is no ticket needed to attend on the days when there is only sprinting, that is the pre/post sprint days and the Friday sprint. So if you join at the end, there is 3 days of consecutive working with the Drupal community for no charge where the people you interact with have no conflicting schedules to do or see sessions. How is that for hands-on experience?
Hope to see you at one of these events and other sprints in 2014 and onwards! Learn Drupal by getting involved, it is for the benefit of us all!
We’re thrilled to announce that the keynote speakers for DrupalCon Austin have been selected. In keeping with tradition, the usual Driesnote will take place on Tuesday morning, while on Wednesday and Thursday we’ll enjoy keynotes from Erynn Petersen and Hugh Forrest.
Here’s what’s in store:Tuesday - June 3
We are getting closer and closer the our long-waited event - Moldcamp. What is Moldcamp? Well, it our very first DrupalCamp held in Moldova. We've worked your butts off to make it as nice as we can. Let's see some stats, details, sessions, etc.
This key is no longer usable:pub 2048R/9C6C32C7 2014-02-16 Laura ARJONA REINA <email@example.com> Laura ARJONA REINA <firstname.lastname@example.org> Laura ARJONA REINA <email@example.com> Old key 0xE20474C3 no longer valid: lost secret key. (Clave antigua 0xE20474C4 ya no es válida: clave secreta perdida.) Fingerprint=F29B A6D8 D1DC A30F 3E34 53DF 5CD1 FDE5 9C6C 32C7
Please act as if it does not exist. The reason is that I cannot remember the passphrase of my master GPG key. This is why I didn’t signed any of the keys of people that I met in Barcelona MiniDebconf. My geek self steem is a bit undermined, but feeling sorry for myself accomplishes nothing, so I think I will not hide problems and move on.
I’ll post about my new key soon.Long version The bad news
The bad news are many.
I generated my key in February 2014 (I generated my very first GPG Key in 2010, as an exercise, but never used it again, and in 2014 I couldn’t remember the passphrase, and the paper where it was written, had got lost before). Anyway, February 2014, new GPG key. I followed the Howto in FSFE wiki in order to use my brand new FSFE SmartCard. I have to admit that I didn’t understand very well how all this works, and it seems that my main mistake was to miss-understand that since I was using a smartcard, with a PIN and an Admin PIN, remembering passphrases was no longer required (only remembering the PINs). I was WRONG! PINs are for daily use with the subkeys of your card (for encryption, decryption, and signing stuff different than GPG keys), you still have the master key that is not in the card (but in a separate medium in a safe place), and for the master key we still use passphrase, and the master key is the one that allows signing keys from other people, and changing, revoking, adding subkeys, etc.
So, it seems I used a random passphrase that I didn’t write down and I could not remember, due to this terrible missunderstanding.
Another bad news is that I didn’t generate a revocation certificate (well in fact, I was going to generate just before signing the first key of another person, and then I realize that it was asking the passphrase, hence the problem). First I thought that it should ask the PIN and my smartcard setup was wrong or anything, but after reading and interchanging emails with other people more experienced than me, I realized that I should remember that passphrase. And I couldn’t. So there are no revocation certificates :(
Another bad news is that some (awesome) people already signed my key, and it will be difficult to meet again so they sign my new key. I was thinking about applying to the Debian new member process this summer, and I have not many opportunities to meet Debian people in person, so I gathered quite a lot signs last March in MiniDebConf Barcelona. Now I’m again at the starting point (well, this is perfect excuse to try to join a Debian event soon :) I don’t know how I would manage to do it, but I’ll try!).The good news (Always look at the bright side of life…)
The main good news is that I didn’t used the GPG key for signing/encrypting important stuff: I just interchanged some encrypted mail as test with friends, and signed some mails sent to public mailing lists (for signing mails I was using the smartcard PIN so I didn’t notiece the problem).
The other main good news is that my key is not compromised (well, you can never be sure, but I think so). I cannot revoke it but I’m quite sure nothing important depends on that key.
Other good news is that I have read a lot about how GPG works and how the smartcard works, keys and subkeys and all this stuff, and I think now I understand everything quite better. I have learned (and also tried) tools as nasty, John The Ripper and rephrase to try to recover the passphrase. I didn’t recover it, but at least I know that all those (free software) tools exist and how to use them :)
And I have learned the lesson: to be extremely careful, test that everything works (not just try one or two things, test everything) and to not leave work for later (and for example, generate the revocation certificates just right after the keys).Next steps
I’ll send a message to all the friends that signed or downloaded my old GPG key apologysing and pointing to this blog post so they learn the details about why I create a new key.
I’ll take this opportunity to download and use the Tails (The Agnostic Incognito System, a Debian derivative which is a “live system” and is focused in protecting privacy and anonymity of the user). Tails will be my safe, network disconnected environment to generate the new keys and do the sensible tasks with them. I think this time I will create my main key 4096-bit long (since now I understand that the main key is not stored in the card) and the subkeys can be 2048-bit or 3072 to fit in the smarcard.
Well, hands on! I’ll write another blog post when my new GPG keys are ready. I hope third time’s the charm!
Note: Thank you to all the people that gave me advice and support (knowledge, links, moral support) about this issue. You know who you are!
Filed under: My experiences and opinion, Tools Tagged: Debian, encryption, English, Free Software, gpg, libre software, Moving into free software, mswl-cases