drupal7

Drupal 7 node creation programmatically

  $node = new stdClass();
  $node->title = "TITLE";
  $node->type = "NODE_TYPE";
  node_object_prepare($node); // Sets some defaults. Invokes hook_prepare() and hook_node_prepare().
  $node->language = LANGUAGE_NONE; // Or e.g. 'en' if locale is enabled
  $node->uid = $user->uid; 
  $node->status = 1; //(1 or 0): published or not
  $node->promote = 0; //(1 or 0): promoted to front page
  $node->comment = 1; // 0 = comments disabled, 1 = read only, 2 = read/write

  // Term reference (taxonomy) field

Drush export/import database

Drupal 6 and 7

$ drush cc
$ drush sql-dump > ~/my-sql-dump-file-name.sql

Drupal 8

$ drush cr
$ drush sql-dump > ~/my-sql-dump-file-name.sql

Download Database from the server

$ scp username@example.com:~/my-sql-dump-file-name.sql ~/projects

Import Database

$ drush sql-drop
$ drush sql-cli < ~/my-sql-dump-file-name.sql