Hi,
I'm trying to migrate an old site to drupal. It contains around 4k mainly static HTML pages and your module has been a godsend in speeding up the migration work. The pages in drupal are well structured and look great.
However, when I change the URL alias of a page it just doesn't seem to work. I checked admin/settings/filters and all aliases created are there, but when I try to use them to access my newly migrated pages, drupal returns 'Page Could not be Found'.
I used 'html2simplehtml.xsl' template to migrate the content.
I decided to try migrating using 'simplehtml2simplehtml.xsl' template and it remedied the issue, however, it grabs the whole body of HTML files I want to migrate and this results in pages with menus, headers and footers which then require a bit of cleaning up. It might take some time considering the number of pages to be migrated.
I was wondering if it would be possible to copy the part of 'html2simplehtml.xsl' responsible for grabbing a particular
Your help will be much appreciated.
Comments
Comment #1
dman commentedSounds odd.
The choice of conversion template only influences the shape of the data that gets scraped - as you have found.
A different conversion template should NOT have any effect on the URL alias creation or validity. The aliases are built directly from the static site filenames in a very different area of the code.
That sounds like the issue to be looking into to find the problem. Maybe some character problem, or slashes not getting cut off correctly. I can't see what admin/settings/filters has to do with things.
Comment #2
leavinghope commentedHi,
Thanks for your reply. It's quite an interesting issue indeed and I'll be looking into it soon. I tried quite few things, mostly trial and error. I managed to resolve the issue by changing one detail in simplehtml2simplehtml template. When using it, IMPORT HTML looks for divs labelled 'content' (as far as I remember) and it simply cannot find them (the site I'm migrating is quite old and sits behind a custom cms with some complex html structure) and imports the whole html body. I changed the template to look for divs labelled 'midMain' (in my case) and it imports everything exactly as I need it. When I change aliases of newly migrated pages, they work fine.
I can't see what admin/settings/filters has to do with things.
I mentioned admin/settings/filters because when you create an alias to a page it should appear there. So I check it to confirm that the alias exists. Just that after migrating pages using html2simplehtml template if you want to change an old alias to a new one, although the alias exists, it doesn't work for some odd reason. I needed to change aliases as the structure of the new website will be completely different.
Simplehtml2simplehtml template with this minor tweak works well for me, but I'll look at this issue when I have some spare time and keep you posted.
Thanks again.
Comment #3
dman commentedWell, the simplehtml2html template is designed to be used as you are doing - all sites need a different pattern to extract the required bit, so tweaking it to get the right part, starting from that template, is totally correct.
Depending on the import options, you may find yourself with two aliases for pages imported from old static sites. The conversion can support either with or without any old *.html (or *.cfm etc) suffixes .. or both.
However, something about what you describe makes me wonder if the paths are somehow being grabbed and made with an incorrect / at one end. In drupal, local url aliases cannot have a / at the beginning or the end.
Comment #4
leavinghope commentedI tried to import few pages using html2simplehtml template again. The pages are imported correctly, but aliases don't work. I can access the pages through 'node/node_number', but when I try to use aliases that were imported from the old website, drupal returns 'Page not Found' message. The same happens when I change an alias and try to use a new one. From what I can see, there are no additional '/' at the end or beginning of the alias. Moreover, when using html2simplehtml template, browser address bar will show 'node/node_number' when viewing newly migrated page. On the other hand, after migrating using simplehtml2simplehtml template, when viewing a newly migrated page browser address bar will show the migrated page's alias.
Just to comment on my previous postings, you were right - admin/settings/filters doesn't have anything to do with this. I was a bit hasty typing it up and I meant URL Alias list which is admin/build/path. Sorry about that.
To sum up, the only thing that changes when I attempt to import pages is the template so that lead me to think that there might be something in the template itself that causes it. I'll keep experimenting and let you know if I have any positive results.
Cheers.
Comment #5
dman commentedI'm really puzzled how things can get into the state you describe.
If you've investigated the alias admin and seen valid paths and node ids there ... I'm trying to imagine why access would fail.
If not slashes ... um, a space where it shouldn't be? Why and how those dud (?) aliases happened and why they can't be repaired later ... it feels something else is causing this error.
Comment #6
leavinghope commentedWhen I'm finished with the task at hand, I will set up a clean installation of drupal and try importing some content again to see if it changes the outcome. It might be one of the modules that I have installed, but this is just guessing, so I'll report when I have some more info.
Comment #7
dman commented