Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

2016 SharePoint Migration/re-direct

I would like to know if it is possible to write an irule that reference 2 different data group lists. first list would hold a list of 2010 sharepoint sites and the second would hold a list of share point sites that have been migrated to 2016 from 2010. Is this possible? we have over a 50 sites and I would prefer to manage data group lists during the migration rather the irule itself. Bob

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Yes, it is possible.

You can use multiple data group in an iRule, and direct the traffic to the 2016 or 2010 pool.

Here are a few links that can help you:
https://devcentral.f5.com/wiki/irules.class.ashx
https://devcentral.f5.com/wiki/irules.pool.ashx
https://devcentral.f5.com/wiki/irules.uri__host.ashx

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

I suggest to create only one datagroup with path as key and pool as value

/app1 := pool-sp2010    
/app2 := pool-sp2010    
/app3 := pool-sp2016   
/app4 := pool-sp2016    

Then read datagroup matching this condition

if {[set sp_pool [class match -value [HTTP::path] starts_with SHAREPOINT_DG]] != ""}    

If it matches, assign pool with

pool $sp_pool
0
Comments on this Answer
Comment made 2 months ago by Robert 1

So if I am only using one DG then would I have to reference default when parameters are not met, with default being the 2010 SP environment. Also, I want to thank all of you for your understanding as irules are not my forte. My requirement is to migrate sharepoint sites in batches under the same URL.

0
Comment made 2 months ago by Robert 1

Let me rephrase my requirement. I need to redirect sharepoint sites after migration under the same URL/VS.

0
Comment made 2 months ago by Robert 1

I think I got it. here is what I have. when HTTP_REQUEST { if {[set sp_pool [class match -value [HTTP::path] starts_with SP_Sites]] != ""} { pool $sp_pool }

}

0
Comment made 2 months ago by Robert 1

The DG now look like so /site1:pool1 /site2:pool1 /site3:pool2 /site4:pool2

0
Comment made 2 months ago by Robert 1

so with URL of https://sharepoint/sites/site1 it will redirect to pool1 correct?

0
Comment made 2 months ago by Stanislas Piron 10454

exact.

you can use this code to manage not listed URL

when HTTP_REQUEST {
     if {[set sp_pool [class match -value [HTTP::path] starts_with SP_Sites]] != ""} {
         pool $sp_pool
     } else {
         pool pool1
     }
}
0
Comment made 2 months ago by Robert 1

gang The above code and data grp is not working. Any ideas?

0
Comment made 2 months ago by Robert 1

I cant' seems to get the pool redirection to work.

0
Comment made 2 months ago by Robert 1

If anyone can help with this I would greatly appreciate it. I am truly at a loss here being a newbie to irules. :-)

0
Comment made 2 months ago by Robert 1

I don't know if this helps but I am seeing "SSL Connection terminated for TCP"

0
Comment made 2 months ago by Stanislas Piron 10454

Can you post here the real irule code you use and the result of this command:

list ltm data-group internal <Name of Datagroup> 
0
Comment made 2 months ago by Robert 1

here is the actual code

Rule established to redirect using pools in assocaition with site listed Data group

when HTTP_REQUEST {

Site lookup occurs in "SP_Sites" Data Group

set debug 1 if {[set sp_pool [class match -value [HTTP::path] starts_with SP_Sites]] != ""} { log local0. " .. starts_with SP_Sites" pool $sp_pool } else { # if Site not in Data Group List then default to Default pool associated with Vitual Server pool SharePoint_Stg_Pool }

}

0
Comment made 2 months ago by Robert 1

Here is the Data group Group name: SP_Sites

doeipwiki := SPPool ttts :=SPPool

0
Comment made 2 months ago by Stanislas Piron 10454

I hope this is not the exact data group configuration...

URI MUST start with /

/doeipwiki := SPPool
/ttts :=SPPool

and I don't see the pool SharePoint_Stg_Pool in your example...

0
Comment made 2 months ago by Robert 1

SharePoint_Stg_Pool is the default pool for the VS

0
Comment made 2 months ago by Robert 1

Uri in date group does start with / sorry

0
Comment made 2 months ago by Robert 1

data group is

/tts := SPPool /doeipwiki := SPPool

0
Comment made 2 months ago by Stanislas Piron 10454

Hi,

I tried the code on my lab, replacing pool assignment by HTTP response with pool info:

#Rule established to redirect using pools in assocaition with site listed Data group
when HTTP_REQUEST {

    #Site lookup occurs in "SP_Sites" Data Group
    set debug 1
    if {[set sp_pool [class match -value [HTTP::path] starts_with SP_Sites]] != ""} {
        log local0. "  .. starts_with SP_Sites"
        #pool $sp_pool
        HTTP::respond 200 content "The selected pool is $sp_pool\r\n"
    }
    else {
        # if Site not in Data Group List then default to Default pool associated with Vitual Server
        HTTP::respond 200 content "The selected pool is SharePoint_Stg_Pool\r\n"
        #pool   SharePoint_Stg_Pool
    }
}

then, I tried some URLs:

$ curl http://192.168.2.34/foo 
The selected pool is SharePoint_Stg_Pool
$ curl http://192.168.2.34/ttts
The selected pool is SPPool
$ curl http://192.168.2.34/
The selected pool is SharePoint_Stg_Pool
$ curl http://192.168.2.34/doeipwiki
The selected pool is SPPool
$ curl http://192.168.2.34/doeipwiki/bar
The selected pool is SPPool
$ curl http://192.168.2.34/doeIPwiki
The selected pool is SharePoint_Stg_Pool

The result is the exact match of the data group... the only part which may cause issue is if the URL doesn't match case... (last example)

0
Comment made 2 months ago by Stanislas Piron 10454

If you want to ignore case, you must convert path to lower case in irule (and make sure all data group keys are lowercase)

#Rule established to redirect using pools in assocaition with site listed Data group
when HTTP_REQUEST {

    #Site lookup occurs in "SP_Sites" Data Group
    set debug 1
    if {[set sp_pool [class match -value [string tolower [HTTP::path]] starts_with SP_Sites]] != ""} {
        log local0. "  .. starts_with SP_Sites"
        #pool $sp_pool
        HTTP::respond 200 content "The selected pool is $sp_pool\r\n"
    }
    else {
        # if Site not in Data Group List then default to Default pool associated with Vitual Server
        HTTP::respond 200 content "The selected pool is SharePoint_Stg_Pool\r\n"
        #pool   SharePoint_Stg_Pool
    }
}

the result change with this :

$ curl http://192.168.2.34/doeIPwiki
The selected pool is SPPool
$ curl http://192.168.2.34/doeipwiki/toto
The selected pool is SPPool
0
Comment made 2 months ago by Robert 1

Doe it matter that this is all https traffic?

0
Comment made 2 months ago by Stanislas Piron 10454

Doe it matter that this is all https traffic?

Http/https is handle as equal!

0