Skip to content

Instantly share code, notes, and snippets.

@davist11
Created April 5, 2012 19:36
Show Gist options
  • Save davist11/2313484 to your computer and use it in GitHub Desktop.
Save davist11/2313484 to your computer and use it in GitHub Desktop.
Viget Blog Migration
Advance = Channel 12 = Category 124
Engage = Channel 17
Extend = Channel 4 = Category 126
FourLabs = Channel 24 = Category 127
Inspire = Channel 8 = Category 125
-- Move advance posts to inspire
UPDATE exp_channel_titles
SET channel_id = 8
WHERE channel_id = 12
UPDATE exp_channel_data
SET channel_id = 8
WHERE channel_id = 12
-- Move engage to advance
UPDATE exp_channel_titles
SET channel_id = 12
WHERE channel_id = 17
UPDATE exp_channel_data
SET channel_id = 12
WHERE channel_id = 17
-- Delete engage channel if there are no posts in it
-- Delete old blog categories
-- PHP
-- Get all the blog posts
SELECT entry_id, channel_id
FROM exp_channel_titles
WHERE channel_id IN (12, 4, 24, 8)
ORDER BY channel_id
-- For each, insert into
INSERT INTO exp_category_posts
SET entry_id = $entry_id,
cat_id = $cat_id
-- And also change to the blog channel
UPDATE exp_channel_titles
SET channel_id = 30
WHERE entry_id = $entry_id
UPDATE exp_channel_data
SET channel_id = 30
WHERE entry_id = $entry_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment