Skip to content

Instantly share code, notes, and snippets.

@tanelj
tanelj / joomla_assets_downloader.rb
Created February 19, 2016 13:13
Migration scripts that imports articles from Joomla database to your Voog website: http://www.voog.com
# This script download all assets linked in articles in Joomla database.
#
# It finds all asset url in article contents (stored in "jos_content" table). And downloads them.
#
# NB! Modify "Configuration" section variables before running this script.
#
# Run this script to see instructions:
#
# ruby joomla_assets_downloader.rb help
#
@tanelj
tanelj / wordpres_to_voog_migration_readme.md
Created February 19, 2016 13:12
Migration scripts that imports articles from Wordpress database to your Voog website: http://www.voog.com

Migrate from Wordpress to Voog

Here are some sctipts that you can use to migrate your articles from Wordpress database to your Voog site.

Step 1: download assets

Edit wordpress_assets_downloader.rb file and setup correct parameters.

Create a folder wp_assets

@tanelj
tanelj / voog_assets_uploader.rb
Last active August 15, 2016 07:00
This script uploads files to your Voog site over API. More about Voog API: http://www.voog.com/developers/api/
# This script uploads files to your Voog site over API.
#
# Run this script:
#
# ruby voog_assets_uploader.rb
#
# Required gems:
# gem install voog_api)
# gem install mime-types
#
@tanelj
tanelj / voog_page_content_copy.rb
Last active May 10, 2022 10:16
Small script to migrate content and/or elements between Voog CMS (www.voog.com) pages. Read more about Voog API www.voog.com/developers/api. Depends on https://gist.github.com/tanelj/a64d58185551976874d5
#!/usr/bin/env ruby
# Script to copy Voog (www.voog.com) page content areas and/or elements between pages.
# It uses functions from Voog migrator script https://gist.github.com/tanelj/a64d58185551976874d5, that should be in same folder.
require_relative 'voog_migrator'
def copy_articles!(mappings)
mappings.each do |k, v|
source_page = @migrator.source.page_by_path(k)
target_page = @migrator.target.page_by_path(v)
@tanelj
tanelj / voog_migrator.rb
Last active March 18, 2019 14:51
Small script to migrate content between websites that are build with Voog CMS (www.voog.com). Read more about Voog API www.voog.com/developers/api
#!/usr/bin/env ruby
# voog_migrator.rb
#
# Small script to migrate content between websites that are build with Voog CMS.
# This tool is using Ruby client of the Voog API: https://github.com/Voog/voog.rb.
#
# Read more about Voog API http://www.voog.com/developers/api.
# This tools allows to analyze source and target host (default action when running this script without any parameters)
@tanelj
tanelj / habtm_validation_bug.rb
Last active August 29, 2015 13:57
Rails 4.1.0.rc1 has_and_belongs_to_many vaidation ignoring error.
# gem 'activerecord', '4.0.3'
gem 'activerecord', '4.1.0.rc1'
# gem 'rails', github: 'rails/rails', branch: '4-1-stable'
require 'active_record'
require 'minitest/autorun'
require 'logger'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)