---
title: "Migrate without code"
video_id: 5UPEo40v1yQ
url: https://www.youtube.com/watch?v=5UPEo40v1yQ
workflow_page: https://workflows-of-ai.com/workflow/migrate-without-code
language: en
captions: generated
---

0:01 hi there Marcus here today's workflow is about migration so what we're going to do is we're going to migrate out in this
0:08 case WordPress site but you can take any uh any site basically any web page and
0:14 migrate that to Drupal without writing a single line of code and setting it up in around 30 minutes and we're not just
0:20 going to migrate we're also going to improve the contact so we're what we're going to do we're going to take
0:27 something that's fairly unstructured or could be completely structure WordPress uses uh uses
0:34 Gutenberg blocks so it is has some kind of structure right but you could think of this as a WIS of Weg page so it's a
0:42 uh review site about Berlin restaurant and I'm I'm going to move this now into Dro ble uh in a very structured way so
0:50 I'm going to show you there's a lot of field here so there's a field for opening hours uh that's using the office
0:56 hours module there's a address field that can show uh the place on a map right and we're
1:04 we're going to add this during the migration as well so anyone that used uh
1:10 that has done database migration or used the migration module knows that this would be a lot of work and sometimes
1:16 it's not even worth it you know might even make more sense to just copy and paste the stuff look up data so in this
1:24 case for instance the office hours it it just says like this from Tuesday to Saturday 1830 into
1:31 2300 and adding this then into the office hours module I can show you uh
1:37 via the office hours module is a lot of work because you have to fill in this right for every day and so on so what we
1:44 have done here we have set up a migration in 30 minutes that moved this and put it into this uh complex field
1:52 types and fill them out so you can see it creates graphs create custom Fields
1:57 creates you know telephone website uh it creates a Google map figures out
2:03 exactly where it is doesn't hallucinate and fills out this opening hours gets
2:09 the images into a gallery and so on so a lot of the things that you actually need to do for a migration uh job so this is
2:17 what I'm going to show you
2:23 now okay so what we have here is a lot of structure field is using um some of
2:29 the core modules but it's also using external modules so this is the office hours module for instance this is the
2:36 address mod uh module when we come to um ratings there
2:43 is the uh custom field modules and there's the chart modules and this this
2:49 chart is a bad example you don't you're never going to show that in our review but I just wanted to show you how you
2:55 can migrate that as well uh what we are migrating for from is currently then a
3:03 WordPress website but uh for this migration to work it doesn't really
3:08 matter as long as it's a website that is available somehow that somehow that you
3:14 can scrap basically so of course this is just possible for simple migration not
3:21 for migration where the values never show up on the website right there you have to still use the normal Dro of
3:26 migration style I'm talking about content migrations um in this case where
3:33 you can even do it from static web pages right you don't even have to have a you know database to database or something
3:39 because it's just scraping for the migration in this case um what is special and what I will show
3:45 you in this case then is that this is uh this is uh a WordPress as you can see
3:53 wordpress.com but this is a private post so all the posts that fictionally
3:59 fiction now needs to be migrat uh migrated or private which means that we
4:04 need a session to be able to see them so I'm going to show how that works as well there are three modules that we need for
4:11 this so there is the AI interpolator simple crawler that's the one that's just going to get the content there is a
4:19 scraping bot version as well so if you actually need JavaScript to render the web page that you're using then you you
4:25 have to use the scraping B but the simple crawler comes with a lot of advantages as well which is uh it's a
4:32 lot faster because it's just service side rendering it's just scraping using guzzle uh you can run it from your local
4:39 machine as well right so you could have a local website you want to migrate from
4:44 to a local website in druple and still be able to scrape it then we use the
4:50 open AI that's going to help us with a lot of the complex field types so using AI to populate this basically but since
4:57 it's using context it's not going to help hallucinate um I will come more to
5:03 that later and then the extractor which has this is nothing has nothing to do with AI but it's very helpful it can
5:10 extract stuff like images into the image field from HTML for
5:15 instance uh so I have already installed this I have already set that up so it's
5:22 basically under open AI settings you have to get the open AI key uh this will be gone by the way
5:29 temporary key same with Google Places config you have to put a Google Places API key which I have done and I will
5:35 explain that is for one specific field right so how we should go uh about this
5:44 now is basically that we have to start with uh having a old page link which is
5:51 a a link and this is basically just the only thing that we're going to have to
5:56 give except for the title so that is the uh this
6:04 link which is then the link to the old website right um as you can see it's uh it's
6:13 using Wordpress which uses like Gutenberg in the end so it is very uh
6:20 unformatted um I mean there is like the Gutenberg blocks right but still it it
6:25 you can think of it almost like a CK editor field so it is very un formatted and we want to make that
6:32 formatted uh so we're adding this link then we just take one we say it's
6:38 required uh for now so the things that we add to migrate we're going to remove
6:43 later right so we set external link we don't need link text we just save this
6:49 and then we need to create a old page HTML as well and format a text text
6:56 format long right so this is basically going to scrape the website then uh and
7:03 this takes full HTML and because I've installed the AI interpolator mod modules in this case
7:09 simple crawler there's rules here and this checkbox shows up so I can enable Ai interpolator and I can choose the uh
7:18 the rule simple crawler this is what we're going to do so this crawls a web page and stores it and we're running
7:25 this in base mode uh we're saying that we want the old page link I will come
7:31 back to what base mode advanced mode is but we want the old page link so not the website that we're showing on the the
7:38 actual page right and uh we need some advanced settings because as I said this
7:44 is behind uh uh authentication so what we're going to do now is we're going to
7:49 go to network reload this and we're going to go to the main page because
7:55 that's going to have cookies here and there is a cookie called WordPress logged in that takes care of the session
8:01 right so we're just going to copy this goes to custom cookies paste the value
8:07 and then I need the key as well so I just said WordPress logged in
8:12 equals and this will log me in maybe I will just search Chrome user agent here
8:19 to get the latest agent here to make sure that word press thinks that I'm
8:24 actual browser as well uh then this part is very important when we're talking
8:30 about migration I'm just going to keep it actually at article segmentation now but uh the reason this module existed
8:38 from the beginning is not for M migration purposes it's rather for uh
8:44 contextualizing for uh AI so there's a surf plugin for instance so you can
8:49 search find links scrape those and use that context as truth because if you
8:55 don't have truth the AI will hallucinate it will come up with stuff that's just not true right but if you give it
9:01 context like given this context answer this question it will answer true
9:07 truthfully um but it has some modes that are very
9:13 uh helpful I think in this case so there's raw dump where you can basically get the whole HTML structure there is
9:19 article segmentation which if we go back to the web page it's a Firefox plugin
9:24 that's open source we're using that can basically get the actual content right so it doesn't care about menus and stuff
9:32 but then what is also uh interesting I think if you're doing migrations is that there is HTML selector so if say that
9:40 this page had a gallery outside of the images that's inside the article and we just wanted to move the gallery then we
9:48 could find a selector for the gallery and dump that and then use the image
9:54 extractor only on those right uh but now I'm going to use everything I'm I'm going to set a lower
10:00 interpolated weight because this has to happen first before anything else right
10:05 uh we have to have the website content before we can start populating other
10:11 fields normally if you do actual migration I mean you would use uh qron
10:17 right uh so use the Cron job to run all the AI jobs and all the uh crawling and
10:24 stuff uh but I want to make it graphically uh nice now so I'm going to
10:30 use the batch API basically and then there is the direct that just saves but that can time out you know you get serve
10:36 time outs uh so this uses the JavaScript batch API instead so I'm going to save
10:42 this then we're going to start adding the other thing that we need to fill out so we need address right uh and this
10:50 uses the address module uh and what we're going to do here we're going to enable the AI interpolator we're going
10:55 to use the rule text address finder base mode uh and we're going to use uh the title
11:02 because the title is the restaurant name right and then we can uh write from the
11:08 context text find the restaurant we're looking for context and then we can just add Berlin because my uh my whole
11:16 um my whole web page is about restaurants in Berlin in this case if it wasn't about restaurants in Berlin what
11:22 you could do is you could create a uh basically an extra field there in
11:29 between that reads the HTML page and asks it hey what are the restaurants
11:34 we're looking for answer with the restaurant's name and the the city name
11:41 basically then we're going to go into advanced settings we're going to do batch we're going to do GPT for turbo in
11:47 this case we just save this uh and here for that we doesn't matter that much
11:53 because that's just dependent on title that we have to fill out anyway next thing is charted ratings which is a
12:00 stupid thing to have but I just wanted to show how it's possible to do this right so this is using the charts uh
12:07 module we're going to once again enable AI interpolator use open AI charts from
12:13 text base mode we're going to use the old page HTML and then we're going to
12:18 say from uh the context page uh context page use the uh
12:29 dishes and their ratings as a chart so what this is going to go
12:37 in uh oh by the way context then that means basically the clean text from the
12:42 base field so that's the HTML without its uh HTML TX you can use raw context
12:48 if the HTML TX is important so what this will do is we'll go down here and look
12:54 at the rating here and the name of this uh dish and create a a a short from that
13:03 basically uh as values probably we should
13:08 write uh and this we do a batch we need to use GPT for Turbo preview for this or
13:16 GPT 4 anything because it's pretty complex uh we just have a higher weight
13:21 than the fetching so this runs later
13:26 um the thing is we probably have to set up the default type as well so I'm just
13:33 going to say that we use high charts and we use a bar chart in this case uh and I know that the range is
13:42 from 0 to five the rating right so we set all that we just save so that set up
13:50 then cine that's a taxonomy term so we have this one I can show you the terms
13:56 it's just beef alal koser vegan and so on that's of course good uh to figure
14:01 out for people that are interested in something specific and this you could do any tonomy term right um we set this
14:08 unlimited because it can be uh you know beef and poultry for instance uh once
14:17 again enable AI interpolator use the O open AI taxonomy rule base mode we can
14:22 do in this case as well take the old page HTML and then we write wait I'm
14:27 just going to copy this actually because that's a pretty good um pretty good prompt there from the
14:37 placeholder so choose uh we don't have to do up to
14:43 based on the context text choose category from the content okay so
14:49 PR fits the text based on the context text menu
14:55 choose category from the category context that fits the text text category option value options com context is then
15:02 the text what is this is going to do is going to go down to the menu read it it's in German but that doesn't matter
15:08 for open AI uh read through it and figure out okay here's fish then we set
15:14 fish I'm not sure if I had a fish actually but calans that that's ve uh
15:19 tail right so it's going to add that to uh beef probably
15:26 uh and so on so it's going to C I and it's going to figure out that it's uh if
15:32 there is a vegan and a vegetarian option as well right automatically once again batch once
15:39 again we do gp4 turbo preview and we save this then we have the email field and in
15:47 this case we don't have to use open AI or be so uh extreme we can just use the email extractor so this is basically a
15:54 regex that looks for emails in the text so there is a email some somewhere here to contact them there right so it's just
16:02 going to find this and set this so we just say this is old page HTML batch
16:08 higher value and that's it Gallery so what we want to do there is
16:14 actually a gallery and a header image so what we want to do is that the gallery gets uh all images except the
16:21 first one so it gets all the other images here and the header images takes the first one so how we're going to do
16:28 this is basic basically that first of all we're going to set uh a minimum image
16:33 Dimension and this is important because if if there happen to be an icon or
16:39 something here it would be stored other way so now it will make sure that the image has to be over 500 500 otherwise
16:46 it doesn't save it right enable AI interpolator use the image extractor on
16:52 the old page HTML batch and then we're going to set offset that we start from the second
16:59 right we don't set the amount we just want everything after that and we save this and then we go to the header image
17:05 we're going to do the exact same thing here uh 500 *
17:11 500 enable AI interpolator on the old page HTML and we turn on batch uh but in this
17:19 case we just get one and we don't set offset right so it just takes the first one
17:26 um and then we come to the oh something I want to do
17:34 first by the way the old page HTML old page link should not be shown right and
17:40 we're going to add it as to the as a tab here as well we just call it old
17:48 page because this we can basically when the migration is finished we can just remove this if we want right because
17:55 after that you can start adding manually if you want of course you can still use the AI anyway so we're done with this
18:02 menu I'm going to skip for now it's pretty complex I have to think actually how to solve that uh opening
18:11 hours is uh using office hours and that just is the same thing and here I'm
18:17 going to show you really the power of AI because this is going to show every day and so on right uh when it's open if you
18:24 look in the text it just says fleetingly here somewhere uh there uh I fil f ctin is open Tuesday to
18:33 Saturday 18:30 to 2300 right so that's what it says that's the only context
18:38 that it has so we're just going to enable this take the old page
18:44 HTML uh we're just going to copy this because this is actually pretty
18:49 good I think let's see here based on the Contex can you return the opening hours
18:56 that you can find Advanced we said batch which takes orable preview 100 so it
19:03 happens after the text is gotten um ratings is a custom field this
19:10 also makes no sense but I just wanted to show you so like custom field uh is a module where you can have
19:16 multiple values or you can create your own complex field type basically and this then has the reviews the rating and
19:24 the the um yeah what did we call the last yeah text let's see name reviews
19:32 rating so this comes from here right name review uh sorry review and rating
19:42 right so we just enable the inflator there is one for custom field we can use
19:48 base field here as well uh and here we have to do multiple
19:53 prompts so this uses like one shot learning where you give examples on how you want it but also a over uh view like
20:04 a uh how do you call it like a you know a parent prompt
20:11 basically uh So based on the context figure out the dishes that got
20:21 reviewed and extract the dish
20:26 name and trans to English so this I stored in German but maybe we want it uh
20:33 in English in this case uh so you see La for instance uh or
20:40 or Gish there so that's um we need to translate this to English
20:47 right so uh extra translate to English also also
20:54 get the numeric rating and
20:59 their review text right so that's uh the
21:06 [Music] uh that's the context let's see
21:13 here so we're just doing that and then we have advanced settings where we actually have to give per each first
21:20 batch then give and one sentence how name should be filled out so this is the
21:27 dish name uh fil trout so this is just
21:32 example of a name fil trout with uh bamal right uh the textual
21:41 review this is the textual review this dish tasted
21:50 awesome and was really good I don't know
21:56 uh the numeric uh uh review inte
22:01 rating and this we give example three we use gp4 Vision turbo preview in this
22:07 case save it uh yeah I can say there is Vision preview so we could even do this from a
22:14 image we don't even need to do it from a an website but this in this case we're talking about migrations right but if
22:21 you ever need to read the text for instance from uh migration so here this
22:26 is just just going to copy here so style is just the style of the restaurant
22:32 basically so we're just going to open up this on Old page HTML do
22:40 batch uh we're just going to copy here based on the content choose category
22:46 from the category based from the content text about the
22:54 restant uh bad GPT 4 Turbo preview
23:00 save that's it and then this is the only thing we're going
23:05 to AI generate so we might want a summary on preview pages right and this
23:11 doesn't really exist here we could do what druple doesn't you know cut it off somewhere but this is usually never good
23:18 summary so we we're actually going to write a summary here instead so we just take AI interpolator open AI text longan
23:25 so this takes text to text based on a prompt and in this case what we can do
23:31 is we can take Advance mode because we want the title in here as well so what we can say here
23:38 is uh for the
23:44 restaurant uh and then we take node title here so in this case we can use multiple
23:51 field to fill in the prompt right no title uh with
23:58 the following context write a summary that is one
24:06 paragraph with two sentences up to 150
24:14 characters context and this we just then take the uh old HTML page HTML we called
24:23 it right and we're just going to take the value so we have it
24:30 there do Advan settings again batch we can use GPT 3 to5 it's usually good at
24:36 summarization and it's cheaper and faster uh then we have a
24:42 telephone uh and in this case there's actually no telephone extractors but this is still smarter because I'm going
24:49 to show you something here so from this whole context reading this text you're going to realize this is about Germany
24:55 right and then there is somewhere uh let's see if we can find a phone number there supposed to be here there's a
25:02 local phone number right the phone uh field wants to store this with country
25:08 code so this can figure this out based on the context right so we're just going to copy this prompt here so based on the
25:16 Contex return all telephone numbers listed with a country code at it and we're going to take the old page HTML
25:23 once again 100 and we're going to take gp4 turbo previews
25:28 save um and then we have text
25:37 review uh well I mean yeah we can use open AI
25:43 text long and we take the O page uh So based on
25:50 the context text only get the texture or all
25:58 review without any images or the menu
26:06 right I I think I hope this works I mean this of course you could do
26:12 programmatically in five minutes writing two lines of code
26:18 but as I said I don't want to use any code in this migration so gp4 turbo
26:24 preview save and last but not least website and
26:29 in this case it's the same as email uh sorry disabled enable and we
26:36 take Link extractor so there is a open AI link you can promp and try to figure out stuff if it's complex but in this
26:43 case we're just going to extract the link basically uh and batch and we don't want
26:50 any links that links to images and stuff of course so we're just going to save
26:55 that and now we're going to do a migration so I Fe Fe that's the title
27:03 right and the other thing we need to fill in oh I have to reload I forgot I
27:10 and the old page is this link and we click save and this is going to start working now so the first thing it's
27:16 going to do is get the HTML and then it's going to start processing all these different fields and try to fill them
27:22 out and there might be be that we need to do some fine tuning but this is basically the general idea to do the
27:31 migration um and then after you're done with this you can just remove all the
27:37 helter fields that we had basically uh and that's it the migration
27:43 is done
27:49 so uh of course this is as you can see slower than my SQL queries but we're talking about migrations where you have
27:56 maybe up to a couple of thousand websites with 10 different entities or
28:01 something up after that of course it makes sense to set up migration script and go through that work but uh up until
28:09 then I think this is actually a nice way of doing the migration
28:19 um let's see when it's finished if we actually get some usable
28:26 results and truthful as well is important of
28:39 course so there we go so we have a header image the actual getting of the
28:46 text didn't work so we have to figure that out uh categories it said so it has
28:52 poultry vegan vegetarian it's a fine dining place which is correct it has SK
28:57 Micheline stuff right uh and then you can see it has actually added the
29:04 ratings on a chart uh we can just check
29:11 one has four rating four
29:18 right uh and here we have them on the
29:23 custom field type and you see they have translated it's leaked it's FAL so we translated to English like we told it to
29:31 this doesn't show the ratings I can show you that just so you don't think the ratings are gone I just didn't want to
29:37 show them so you can see that the rating is hidden right so if I click edit there's the rating is going to be there
29:44 click contact data email filled in website filled in there's a address there's a opening hour that has been set
29:52 correctly right so 183 to 2300 and then there's gallery this looks
29:57 ugly I know I didn't want to install a gallery module but it is the four images that comes after you can click on them
30:04 and you have the image right uh and that's basically the idea
30:11 of it all that's how you can do a simple migration for websites and even improve
30:16 the content right um so what didn't work now then
30:23 was the actual uh uh the actual text here so the text
30:33 review didn't really work and the problem be between uh
30:39 because the problem with this is basically that it would probably have wanted to split it up in multiple Fields
30:46 due to how the interpolator works so in this case I guess uh using uh code would
30:53 be better uh I will think about it and think we can get the text menu out as
30:59 well it shouldn't actually be a problem uh but you get anyway a summary here as
31:04 well right to sentences what we talked about and I can just show you under ratings that the ratings are set in this
31:11 custom field type as well so what we could do now is just remove these two
31:16 Fields remove this tab and the migration is done right we have moved from the old
31:22 to the new oh telephone didn't work so we probably have to so here's the thing with prompts they they are with AI to
31:30 start with it's not deterministic it can answer different depending on settings and so on but there's a lot of prompt
31:37 engineering going into this as well so you have to Perfect The Prompt so uh we
31:43 we can try to do that actually just to show you how it works then with a phone uh so you get a a better idea on
31:52 how long time this takes to set up because I just copied all the placeholder stuff right So based on the
31:58 context text find all potential
32:05 telephone numbers and return them with the country
32:13 code added with a plus sign maybe we need to be very very Boer so we just
32:20 save this and then you can just resave as long as this is not filled out it's going to try to get it again right so
32:25 I'm just going to try to resave and it should run one job now uh oh it didn't actually run that's
32:33 maybe no here it is I maybe had this set to direct right yeah because it didn't use the batch ah okay so that's why it
32:41 failed sorry I forgot to set this to batch which meant direct runs before the batch API runs so the HTML didn't exist
32:49 so there was actually nothing wrong with my prompt I just did another error there
32:55 so that was the reason so so the telephone is filled out now we have the results and that's it
33:01 basically so what we spent half an hour to set up this migration and now you could just you know use the CV CSV
33:08 import a module that exists for instance a great module where you can you know create entities from this and that's it
33:14 you have your migration done or also of course in the case you maybe just have 100 websites you could
33:21 even copy and paste the links just manually so that's it thank you for for
33:27 watching
